How to I tell my own custom Spinner Layout to use my Theme?
- by jax
How to I tell my own custom Spinner Layout to use my Theme?
Style:
<style name="SpinnerText" parent="@android:style/Widget.TextView.SpinnerItem">
<item name="android:textAppearance">@style/AnswerTextElement</item>
<item name="android:gravity">center_vertical|center_horizontal</item>
</style>
Theme:
<style name="ApplicationTheme" parent="android:style/Theme.NoTitleBar">
<item name="android:buttonStyle">@style/Button</item>
<item name="android:spinnerStyle">@style/Spinner</item>
<item name="android:spinnerItemStyle">@style/SpinnerText</item>
</style>
This works for default Spinners, however does not work with my custom layout:
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android">
<TextView android:layout_height="wrap_content" android:id="@+id/text1"
android:text="label name" android:layout_width="fill_parent"
android:layout_toLeftOf="@+id/check1"></TextView>
<CheckBox android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/check1"
android:layout_alignParentRight="true" android:clickable="false"
android:focusable="false" android:focusableInTouchMode="false"
style="@style/CheckBoxPlainBackground"></CheckBox>
</RelativeLayout>