how to apply multiple Styles in android in same xml

jigar

Hi i have made an android program in that i have put a single nine path button for all the activities but i have applied one style for it but for other activities different styles for margin are needed...So. i have my one style as per below:So can i put another style for same element in same style.xml file? my code is as 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>
Henrik Christensen

You can make a sub-style by doing something like this

<style name="otherButton" parent="button">  
    <item name="android:layout_marginLeft">50dp</item>    
...

This style inherits everything from its parent style. Everything you define in the sub-style will overrule any previously defined properties.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to apply multiple styles in WPF

How to apply multiple XSLT transformations to the same XML table

Multiple styles.xml files in Android Studio

How to use multiple styles for the same depth heading?

How do I apply two styles in the same line in LibreOffice?

How to apply different CSS styles to 2 elements with the same class name?

How can I apply styles to multiple classes at once?

How to apply styles to multiple components using styled components

How to apply styles in PHPExcel

how to apply same filter to multiple dataframes

How to apply the same props to multiple styled components?

How to apply multiple condition in same column in excel

Elasticsearch: how to apply multiple filters to the same value?

How to apply the same change to multiple pages at once?

how to apply same function to multiple dataframes in R

how to apply same function to multiple divs

How to apply the same function to multiple ID's?

How to apply multiple functions to same column in Python?

How to apply multiple imports in XSLT for xml generation

How to use multiple independent conditional styles on same div in reactjs?

How to apply css styles to a tag?

How to apply styles based on props?

How to create custom button in Android using XML Styles

How to modify expo android styles.xml in react native app

How to add 2 styles in a component/view in android xml

Apply Multiple Styles to a data frame specific column

Apply multiple styles to a single Text - Jetpack Compose

Multiple choropleth layers apply different styles

how to create a xml with multiple same tags with python