【每日一劑】---帶邊框按鈕

帶邊框按鈕
1、

<Button
        android:id="@+id/btn"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/white_rectangle"
        android:text=“BTN"
        android:textColor="#ff4888"
        android:textSize="16sp" />

2、

white_rectangle.xml放到drawable文件夾下
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android = "http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
  <solid android:color="#ffffff" />
  <corners  android:radius="4dp"/>
  <stroke android:width="1dp" android:color="#ff4861"/>
</shape>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章