<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國際加速解決方案。 廣告
                #### 6.2.6 TransitionDrawable TransitionDrawable對應于`<transition>`標簽,它用于實現兩個Drawable之間的淡入淡出效果,它的語法如下所示。 <? xml version="1.0" encoding="utf-8"? > <transition xmlns:android="http://schemas.android.com/apk/res/android" > <item android:drawable="@[package:]drawable/drawable_resource" android:id="@[+][package:]id/resource_name" android:top="dimension" android:right="dimension" android:bottom="dimension" android:left="dimension" /> </transition> 上面語法中的屬性前面已經都介紹過了,其中android:top、android:bottom、android:left和android:right仍然表示的是Drawable四周的偏移量,這里就不多介紹了。下面給出一個實際的例子。 首先定義TransitionDrawable,如下所示。 // res/drawable/transition_drawable.xml <? xml version="1.0" encoding="utf-8"? > <transition xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/drawable1" /> <item android:drawable="@drawable/drawable2" /> </transition> 接著將上面的TransitionDrawable設置為View的背景,如下所示。當然也可以在ImageView中直接作為Drawable來使用。 <TextView android:id="@+id/button" android:layout_height="wrap_content" android:layout_width="wrap_content" android:background="@drawable/transition_drawable" /> 最后,通過它的startTransition和reverseTransition方法來實現淡入淡出的效果以及它的逆過程,如下所示。 TextView textView = (TextView) findViewById(R.id.test_transition); TransitionDrawable drawable = (TransitionDrawable) textView.getBackground(); drawable.startTransition(1000);
                  <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>

                              哎呀哎呀视频在线观看