有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java错误膨胀类<unknown>可能<com。谷歌。安卓布料文本字段。文本输入布局

我有一个带有fab按钮的FrameLayout,我希望它在单击时显示一个自定义警报对话框。 但我面临Error inflating class <unknown> 它在开始时显示error inflating class com.google.安卓.material.textfield.TextInputLayout 这是我的自定义警报对话框的代码

 <com.google.安卓.material.textfield.TextInputLayout
        安卓:id="@+id/title_text_input"
        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
        安卓:layout_width="match_parent"
        安卓:layout_height="wrap_content"

        安卓:layout_marginStart="32dp"
        安卓:layout_marginTop="16dp"
        安卓:hint="@string/title">

        <com.google.安卓.material.textfield.TextInputEditText
            安卓:layout_width="match_parent"
            安卓:layout_height="wrap_content" />

    </com.google.安卓.material.textfield.TextInputLayout>


    <com.google.安卓.material.textfield.TextInputLayout
        安卓:id="@+id/lesson_number_text_input"
        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
        安卓:layout_width="match_parent"
        安卓:layout_height="wrap_content"
        安卓:layout_marginStart="32dp"

        安卓:layout_marginTop="16dp"
        安卓:hint="@string/lesson_number">

        <com.google.安卓.material.textfield.TextInputEditText
            安卓:layout_width="match_parent"
            安卓:layout_height="wrap_content" />

    </com.google.安卓.material.textfield.TextInputLayout>


    <com.google.安卓.material.textfield.TextInputLayout
        安卓:id="@+id/link_text_input"
        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
        安卓:layout_width="match_parent"
        安卓:layout_height="wrap_content"
        安卓:layout_marginStart="32dp"
        安卓:layout_marginTop="16dp"
        安卓:hint="@string/video_id">

        <com.google.安卓.material.textfield.TextInputEditText
            安卓:layout_width="match_parent"
            安卓:layout_height="wrap_content" />

    </com.google.安卓.material.textfield.TextInputLayout>

    <Button
        安卓:layout_width="match_parent"
        安卓:layout_height="wrap_content"
        安卓:layout_marginTop="24dp"
        安卓:text="@string/upload_to_firebase" />

我用于应用程序的样式

 <style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

材料设计相关性implementation 'com.google.安卓.material:material:1.3.0'

方法显示自定义警报对话框

AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getContext());
        LayoutInflater inflater = getLayoutInflater();

        View dialogView = inflater.inflate(R.layout.add_learning_vid_alert_dialog, null);
        dialogBuilder.setView(dialogView);

        mGradeSpinner = dialogView.findViewById(R.id.grade_level_spinner);
        mSubjectSpinner = dialogView.findViewById(R.id.subjects_spinner);

        mTitleTextInput = dialogView.findViewById(R.id.title_text_input);
        mLessonNumberTextInout = dialogView.findViewById(R.id.lesson_number_text_input);
        mLinkTextInput = dialogView.findViewById(R.id.link_text_input);

        AlertDialog alertDialog = dialogBuilder.create();
        alertDialog.show();

有人能帮我解决这个问题吗


共 (0) 个答案