Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/181.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 设置应用程序的自定义主题时TextInputLayout崩溃_Android_Android Styles_Android Textinputlayout - Fatal编程技术网

Android 设置应用程序的自定义主题时TextInputLayout崩溃

Android 设置应用程序的自定义主题时TextInputLayout崩溃,android,android-styles,android-textinputlayout,Android,Android Styles,Android Textinputlayout,下面的代码与outline输入框完美配合 <com.google.android.material.textfield.TextInputLayout android:id="@+id/notes" style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" android:layout_width="match_parent" android:la

下面的代码与outline输入框完美配合

<com.google.android.material.textfield.TextInputLayout
        android:id="@+id/notes"
        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/text_notes"
        app:boxBackgroundColor="@color/colorWhite">

        <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/et_notes"
            android:fontFamily="sans-serif-black"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

    </com.google.android.material.textfield.TextInputLayout>

材质组件,如
com.google.android.Material.textfield.TextInputLayout
(注意包名的
.Material.
部分),需要使用材质主题

此页面列出了要使用的适当主题:

您必须从此更改应用程序的主题


到例如这个

<style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">


谢谢!特定于活动,我已更改主题,自定义字体也可以正常工作。设置此样式后,应用程序工具栏标题不会显示。我试着用custum风格改变颜色,但不起作用。任何想法。。。
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">