Android style inheritance not working -


styles.xml

    <style name="red" parent="android:textappearance.devicedefault.medium.inverse">         <item name="android:textcolor">#f00</item>     </style>      <style name="red.large">         <item name="android:textsize">30sp</item>     </style> 

when use this;

<button     android:id="@+id/save"     android:text="@string/save"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_margintop="@dimen/save_margintop"     android:gravity="center"     style="@style/red.large"/> 

this button attribute large , doest painting red. why?

your red.large style needs use parent attribute. red.large inherit red if changed to:

<style name="red.large" parent="red">     <item name="android:textsize">30sp</item> </style> 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -