Tuesday, 16 September 2014

how to change the color of the button in main activity?



Hey guys i would like to ask how to change the color of the buttons in the actiity main xml. The button are from the palette of the eclipse and are not image views buttons but the simple ones. here is my code


activity_main.xml:



xmlns:tools="http://ift.tt/LrGmb4"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/default1"
android:orientation="vertical"
tools:context="ca.my.demo.buttondemo.MainActivity" >

<Button

android:id="@+id/btnDisplayMessage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:text="Kreatika"
android:textColor="#ffffff"
android:textStyle="bold|italic" />

<Button

android:id="@+id/btnDisplayMessage1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginTop="63dp"
android:text="Galaktokomika"
android:textColor="#ffffff"
android:textStyle="bold|italic" />

<Button

android:id="@+id/btnDisplayMessage2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/btnDisplayMessage1"
android:layout_marginTop="24dp"
android:text="Allantika"
android:textColor="#ffffff"
android:textStyle="bold|italic" />

No comments:

Post a Comment