Material TextInputLayout - 样式 `ThemeOverlay.MaterialComponents.TextInputEditText.OutlinedBox` 更改框未聚焦颜色
Material TextInputLayout - style `ThemeOverlay.MaterialComponents.TextInputEditText.OutlinedBox` change box unfocused color
我在应用程序中使用 material com.google.android.material.textfield.TextInputLayout
。当 TextInputEditText
没有焦点时,我想更改框轮廓颜色。
我已经尝试在样式中设置 colorControlNormal
、colorControlActivated
、colorControlHighlight
,但它们似乎不起作用。只有聚焦的颜色变化,未聚焦的颜色不变。此外,我还尝试在样式中添加 colorOnSurface
,但该属性似乎在稳定版本中不存在。
有人的帮助将不胜感激。
您需要使用 material
库的最新 dependencies
用这个
implementation 'com.google.android.material:material:1.2.0-alpha03'
我在应用程序中使用 material com.google.android.material.textfield.TextInputLayout
。当 TextInputEditText
没有焦点时,我想更改框轮廓颜色。
我已经尝试在样式中设置 colorControlNormal
、colorControlActivated
、colorControlHighlight
,但它们似乎不起作用。只有聚焦的颜色变化,未聚焦的颜色不变。此外,我还尝试在样式中添加 colorOnSurface
,但该属性似乎在稳定版本中不存在。
有人的帮助将不胜感激。
您需要使用 material
库的最新 dependencies
用这个
implementation 'com.google.android.material:material:1.2.0-alpha03'