Reputation: 135
I changed background color of my activity using android:background. Background color changes but color of button background changes too. I want to keep button with default background and properties.
Button looks like as shown in this image.
XML file of Activity is below
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="#116493">
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:attr/buttonStyleSmall"
android:text="Button" />
</LinearLayout>
Upvotes: 1
Views: 61
Reputation: 75798
@Nimit Aggarwal: Please update your theme settings . Remove style="?android:attr/buttonStyleSmall"
.
Add button
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/your_image"
android:text="Button" />
For demo purpose please follow Android ImageButton selector example
Upvotes: 1