<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                [TOC] # 1. 前言 在開發中,我們常使用xml方式定義selector,并指定手指按下和釋放所對應的shape.xml文件,在這個文件中,常用來做背景或者圓角等。這里再次回顧一下。 # 2. 回顧 注意:shape 標簽所對應的 Java 類是 GradientDrawable,而不是 ShapeDrawable 。但,神奇的是, ShapeDrawable 與 GradientDrawable 的用法基本一樣。但是在使用的時候,強轉類型不要弄混淆。 # 3. 使用 ## 3.1 給按鈕添加圓角 btn_bg_round.xml: ~~~ <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="false" android:drawable="@drawable/btn_normal"/> <item android:state_pressed="true" android:drawable="@drawable/btn_pressed" /> </selector> ~~~ btn_normal.xml: ~~~ <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <corners android:radius="20dp"/> <solid android:color="#DB5860"/> </shape> ~~~ btn_pressed.xml: ~~~ <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <corners android:radius="20dp"/> <solid android:color="#F50512"/> </shape> ~~~ 然后使用: ~~~ <Button android:layout_centerInParent="true" android:background="@drawable/btn_bg_round" android:layout_width="300dp" android:layout_height="50dp"> </Button> ~~~ 效果: ![](https://img.kancloud.cn/80/90/809002c6a0320a803732263159efe47f_340x81.png)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看