赞
踩
- <style name="CustomAppTheme_textinputLayout" parent="Theme.AppCompat.Light.NoActionBar">
-
- <item name="colorAccent">#3498db</item>
- <item name="android:textColorHint">@color/alpha_white</item>
- <item name="colorControlNormal">@color/alpha_white</item>
- <item name="colorControlActivated">@color/white</item>
- <item name="colorControlHighlight">@color/white</item>
- <item name="android:windowTranslucentStatus">true</item>
- </style>
如果你按上面说的在5.0之后使用是没有问题的,但是如果你要放在5.0以下的版本你会发现颜色并没有改变,这时候你需要给你当前activity单独指定一个theme了.
- <style name="CustomAppTheme_textinputLayout" parent="Theme.AppCompat.Light.NoActionBar">
-
- <!-- <item name="colorAccent">#3498db</item> -->
- <item name="android:textColorHint">@color/alpha_white</item>
- <item name="colorControlNormal">@color/alpha_white</item>
- <item name="colorControlActivated">@color/white</item>
- <item name="colorControlHighlight">@color/white</item>
- <item name="android:windowTranslucentStatus">true</item>
- </style>
- <activity
- android:name=".activity.login.LoginActivity"
- android:theme="@style/CustomAppTheme_textInputLayout">
- </activity>
长时间放后台运行再次回到界面即使没有使用TextInputLayout的error提示作用会发现线都变红了这时候你需要在代码中设置禁用
TextInputLayout.setErrorEnabled(false);
浮动hint改变size
etc:
style name=”TextLabel” parent=”TextAppearance.Design.Hint”
item name=”android:textSize”>14sp item
style
app:hintTextAppearance="@style/TextLabel"
- <style name="TextLabel" parent="TextAppearance.Design.Hint" >
- <item nname="android:textSize">14sp</item>
- </style>
参考:
https://blog.csdn.net/qingdaohaoyunpeng/article/details/51915374
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。