<Button android:id="@+id/btn_showcamera_usephoto" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:background="@color/activity_showcameraview_bottom" android:gravity="center" android:text="@string/IDS_COMPAN_PAN_00036" android:textColor="@color/selector_showcamera_view_bottom" android:textSize="15dp" android:visibility="visible" />
selector_showcamera_view_bottom 如下:
要在res文件夹下新建color文件夹,然后将selector_showcamera_view_bottom.xml放入里面
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:color="#a5d3f4"/> <!-- pressed --> <item android:state_focused="true" android:color="#a5d3f4"/> <!-- focused --> <item android:color="#ffffff"/> <!-- default --> </selector>
activity_showcameraview_bottom 如下:
<color name="activity_showcameraview_bottom">#222222</color>
时间: 2024-10-29 21:16:45