设置按钮按下效果

2020-09-17  本文已影响0人  小婷婷tt
  1. select_btn_green_radius_17point5.xml
    <?xml version="1.0" encoding="utf-8"?>
    <selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/btn_green_radius_17point5" android:state_pressed="false" />
    <item android:drawable="@drawable/btn_green_radius_17point5_press" android:state_pressed="true" />
    </selector>

  2. btn_green_radius_17point5.xml
    <?xml version="1.0" encoding="utf-8"?>
    <shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <solid android:color="#56BB7C" />
    <corners android:radius="17.5dp" />
    </shape>

  3. btn_green_radius_17point5_press.xml
    <?xml version="1.0" encoding="utf-8"?>
    <shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <solid android:color="#3A925B" />
    <corners android:radius="17.5dp" />
    </shape>

上一篇 下一篇

猜你喜欢

热点阅读