標籤:
<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>
【Android_樣式】Button 文字樣式變更