更改默认的文本输入布局样式?



我正在使用材料设计组件,并希望更改TextInputLayout的默认样式,这意味着我的更改将应用于TextInputLayout的所有实例,而无需在每个实例上显式定义style="@style/my_style"

如果这不可能,怎么可能?

您可以在应用主题中使用textInputStyle属性。

<style name="AppTheme" parent="Theme.MaterialComponents.DayNight"> 
<item name="textInputStyle">@style/myCustomStyle</item>
</style>

最新更新