Set style to child from it's parent

SagarPanwalaSagarPanwala Sagar PanwalaUSMember ✭✭
edited September 2014 in Xamarin.Android

I want to set style to child view from it's parent style.I have 10 textview in my view.So I want to declare style for parent view and change style of all textview.
Here , is my layout.

        <LinearLayout
            android:orientation="vertical"
            android:layout_width="0dp"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            style="@style/Tab">
            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/home_tab" />
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Home"/>
        </LinearLayout> 

and here is my style

    <?xml version="1.0" encoding="UTF-8" ?>
    <resources>
        <style name="Tab">      
            <item name="android:padding">5dp</item>
            <item name="android:gravity">center</item>
            <item name="android:background">#ff776e6e</item>                
        </style>

style all textview which is inside Tab style parent.

        <style name="Tab.TextView">
            <item name="android:textColor">#000</item>             
            <item name="android:typeface">monospace</item>
        </style>
    </resources>
Sign In or Register to comment.