使用AndroidX勾勒文本字段

使用AndroidX勾勒文本字段,android,android-edittext,textfield,androidx,Android,Android Edittext,Textfield,Androidx,我将我的项目更新为androidx: implementation 'androidx.appcompat:appcompat:1.0.0' 现在,来自MaterialComponents的OutlinedBox导致我的应用程序崩溃 style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" 我可以用editText背景创建大纲作为背景,但是有没有办法用androidx和材质组件来实现呢?或者我遗漏了什么?样式样式

我将我的项目更新为androidx:

implementation 'androidx.appcompat:appcompat:1.0.0'
现在,来自MaterialComponents的OutlinedBox导致我的应用程序崩溃

style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
我可以用editText背景创建大纲作为背景,但是有没有办法用androidx和材质组件来实现呢?或者我遗漏了什么?

样式样式=@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox属于材质组件,您需要通过添加以下依赖项来实现它:实现“com.google.android.Material:Material:1.1.0-alpha06”。记住也要从材质组件继承应用程序主题:

<style name="MyAppTheme" parent="Theme.MaterialComponents.Light.Bridge">
    <!-- ... -->
</style>
有关更多详细信息,请阅读