3

Is there any way by which we can set hint Text color (setHintTextColor) for an entire layout, i.e all the child elements in that layout?

Moreover, I would prefer to do it programmatically, and not through layout xml.

A Nice Guy
  • 2,676
  • 4
  • 30
  • 54

1 Answers1

10

You can create your own theme which styles the colorHint:

<style name="AppTheme" parent="Theme.AppCompat"
    <item name="android:textColorHint">@color/text_color_hint</item>
</style>
Rick
  • 3,943
  • 6
  • 33
  • 45
  • This works fine within the Layout where I use this style, but doesn't seem to work for the child elements – A Nice Guy Jan 25 '14 at 16:39
  • Maybe this http://stackoverflow.com/questions/8395168/android-get-children-inside-a-view can help you? – Rick Jan 25 '14 at 17:10
  • Thanks for the link.. yes of cource i can find all the child elements and setHintTextColor in all of them, but I wanted to know if there is any way I can add the setHintTextColor property at one place(presumably at the parent layout) rather than going through the costly and messy iteration... – A Nice Guy Jan 25 '14 at 17:27