我正在使用材料设计组件,并希望更改TextInputLayout
的默认样式,这意味着我的更改将应用于TextInputLayout
的所有实例,而无需在每个实例上显式定义style="@style/my_style"
。
如果这不可能,怎么可能?
您可以在应用主题中使用textInputStyle
属性。
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight">
<item name="textInputStyle">@style/myCustomStyle</item>
</style>