圓角矩形按鈕
drawable文件夾下新建資源文件
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="15dp" />
<!-- 定義圓角度數-->
<solid android:color="#80D8FF" />
<!-- 定義填充顏色-->
<!-- 文件名 shape_button 對應第一個按鈕圓角效果-->
</shape>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient android:startColor="#FF80AB"
android:endColor="#EA80FC" />
<!-- 定義漸變開始和結束顏色 第二個按鈕漸變效果-->
<!-- 文件名shape_button2 -->
</shape>
在兩個Button的背景屬性中分別引用以上兩個資源文件
效果如右圖
分割線 View V記得大寫 不然會報空指針
<View
android:layout_width="match_parent"
android:layout_height="5dp"
/>