Android 如何为整个版面设置提示文本颜色?
是否有任何方法可以为整个版面(即该版面中的所有子元素)设置提示文本颜色(setHintTextColor)Android 如何为整个版面设置提示文本颜色?,android,android-layout,android-styles,Android,Android Layout,Android Styles,是否有任何方法可以为整个版面(即该版面中的所有子元素)设置提示文本颜色(setHintTextColor) 此外,我更喜欢以编程方式进行,而不是通过布局xml。您可以创建自己的主题,它为colorHint设置样式: <style name="AppTheme" parent="Theme.AppCompat" <item name="android:textColorHint">@color/text_color_hint</item> </style
此外,我更喜欢以编程方式进行,而不是通过布局xml。您可以创建自己的
主题
,它为colorHint
设置样式:
<style name="AppTheme" parent="Theme.AppCompat"
<item name="android:textColorHint">@color/text_color_hint</item>
</style>
这在我使用这种样式的布局中很好用,但对子元素似乎不起作用。这能帮到你吗?谢谢你的链接。。当然可以,我可以找到所有的子元素和setHintTextColor,但我想知道是否有任何方法可以在一个位置(大概是在父布局)添加setHintTextColor属性,而不必经历昂贵而混乱的迭代。。。