how to apply multiple Styles in android in same xml -


hi have made android program in have put single 9 path button activities have applied 1 style other activities different styles margin needed...so. have 1 style per below:so can put style same element in same style.xml file? code below:

<style name="button">         <item name="android:layout_width">fill_parent</item>         <item name="android:layout_height">wrap_content</item>          <item name="android:layout_marginleft">30dp</item>             <item name="android:layout_marginright">30dp</item>         <item name="android:layout_weight">1</item>         <item name="android:tag">200</item>         <item name="android:padding">7dp</item>         <item name="android:textsize">15dp</item>         <item name="android:textcolor">#f5f0eb</item>     </style> 

you can make sub-style doing this

<style name="otherbutton" parent="button">       <item name="android:layout_marginleft">50dp</item>     ... 

this style inherits parent style. define in sub-style overrule defined properties.


Comments