【发布时间】:2015-10-25 13:34:26
【问题描述】:
我使用 android:background 更改了我的活动的背景颜色。背景颜色会发生变化,但按钮背景的颜色也会发生变化。我想保留具有默认背景和属性的按钮。
按钮如图所示。
Activity的XML文件在下面
<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>
【问题讨论】:
-
只需设置按钮的背景。问题解决了
-
@Nimit,很高兴听到。
标签: android android-layout android-activity