I am writing an android app and I am wanting to alter the theme of my app.
I have managed to alter the background colour of the app by using a theme, but I am struggling to change the default text appearance.
This is my styles.xml resource file.
<resources>
<style name="QTheme" parent="android:Theme.Light">
<item name="android:windowBackground">@color/q_green</item>
<item name="android:colorBackground">@color/q_green</item>
<item name="android:textAppearance">@style/QText</item>
</style>
<color name="q_green">#008000</color>
<color name="white">#FFFFFF</color>
<style name="QText" parent="@android:style/TextAppearance.Medium">
<item name="android:textSize">20sp</item>
<item name="android:textColor">@color/white</item>
<item name="android:textStyle">bold</item>
<item name="android:textFont">Verdana</item>
</style>
</resources>
and just to check, this is an example of one of my TextViews I want to use the above style in my layout file.
<TextView
android:id="@+id/txtDevice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/device"
/>
Can anyone see where I am going wrong?
TextAppearance.Medium
style in your theme(which will not modify theTextView
). If you want to modify theTextView
look then override thetextViewStyle
style attribute in your theme. Or you could apply your custom style usingandroid:textAppearance
Spinner
'sTextView
item has a different style(which still inherits from theTextView
style), pointed by thespinnerItemStyle
attribute in the theme. You may want to set that to@android:style/Widget.TextView.SpinnerItem
and see how that goes.