Shalvin Interests

Saturday, June 25, 2016

Android Style

colors.xml
<resources>
    <color name="colorPrimary">#3F51B5</color>
    <color name="colorPrimaryDark">#303F9F</color>
    <color name="colorAccent">#FF4081</color>
    <color name="colorYellow">#FFFF00</color>
</resources>


styles.xml


 <style name="buttonStyle">
        <item name="android:background">@color/colorYellow</item>
    </style>

<Button
        style="@style/buttonStyle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hello"
        android:id="@+id/button"
        android:layout_centerVertical="true"
        android:layout_alignParentStart="true" />

No comments:

Post a Comment