coffee
- Forum posts: 1
Oct 27, 2012, 6:10:54 PM via Website
Oct 27, 2012 6:10:54 PM via Website
hi, all!
I am a newbie in Android development, just started with styles.
I have seen that practically for each View element its style is available, for example:
and here the text color for Spinner is set.
How do I know, that the correct parent style is Widget.TextView.SpinnerItem or Widget.DropDownItem.Spinner? In the API reference, only available attributes are described, not the whole style name.
I am a newbie in Android development, just started with styles.
I have seen that practically for each View element its style is available, for example:
1<style name="Theme.NoTitleBar.WithColoredSpinners" parent="@android:style/Theme.NoTitleBar">
2 <item name="android:spinnerItemStyle">@style/SpinnerItem</item>
3 <item name="android:spinnerDropDownItemStyle">@style/SpinnerItem.DropDownItem</item>
4 </style>
5
6 <style name="SpinnerItem" parent="@android:style/Widget.TextView.SpinnerItem">
7 <item name="android:textColor">#00FF00</item>
8 </style>
9
10 <style name="SpinnerItem.DropDownItem" parent="@android:style/Widget.DropDownItem.Spinner">
11 <item name="android:textColor">#FF0000</item>
12 </style>
2 <item name="android:spinnerItemStyle">@style/SpinnerItem</item>
3 <item name="android:spinnerDropDownItemStyle">@style/SpinnerItem.DropDownItem</item>
4 </style>
5
6 <style name="SpinnerItem" parent="@android:style/Widget.TextView.SpinnerItem">
7 <item name="android:textColor">#00FF00</item>
8 </style>
9
10 <style name="SpinnerItem.DropDownItem" parent="@android:style/Widget.DropDownItem.Spinner">
11 <item name="android:textColor">#FF0000</item>
12 </style>
and here the text color for Spinner is set.
How do I know, that the correct parent style is Widget.TextView.SpinnerItem or Widget.DropDownItem.Spinner? In the API reference, only available attributes are described, not the whole style name.
Recommended editorial content
With your consent, external content is loaded here.
By clicking on the button above, you agree that external content may be displayed to you. Personal data may be transmitted to third-party providers in the process. You can find more information about this in our Privacy Policy.