Android button設置背景色與邊框顏色

                                                                         Android button設置背景色與邊框顏色

1.在drawable文件夾下面創建setbar_bg.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
    <!-- 背景色 -->
    <solid android:color="#00000000"/>
    <!-- 邊框色 -->
    <stroke android:width="0.5dip" android:color="#f00" />
</shape>
2.設置button順序

 android:background="@drawable/setbar_bg"


去看看效果吧!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章