Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

multiple style values inside a view

Tags:

android

I have 2 styles defined inside styles.xml. I want to apply it to a textview. How to implement that using style = "@style/"

like image 261
Anju Avatar asked Nov 23 '10 04:11

Anju


2 Answers

You can't. You will have to create a style which combines the two styles. (Or create just one style that inherits from one of your styles, and add the extra data of the second style).

like image 144
Cristian Avatar answered Sep 27 '22 19:09

Cristian


You can make a style that inherit the other style

For example:

<style name="Side_Menu_Button" parent="android:attr/buttonStyleSmall">     <item name="android:layout_width">wrap_content</item>     <item name="android:layout_height">match_parent</item> </style> 

Where the side_menu_button inherit from all the attribute of buttonStyleSmall

like image 21
hook38 Avatar answered Sep 27 '22 17:09

hook38