<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>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # 1. LayoutAnimation 用于為`ViewGroup`指定一個動畫,其子元素也就具有了它的出場動畫效果。這種效果常用在`ListView`上。 # 2. 屬性 在`res/anim`目錄下新建一個`layoutanimation01.xml`的文件: ~~~ <?xml version="1.0" encoding="utf-8"?> <layoutAnimation xmlns:android="http://schemas.android.com/apk/res/android" android:delay="0.5" android:animationOrder="normal" android:interpolator="@android:anim/linear_interpolator" android:animation="@anim/item_anim" > </layoutAnimation> ~~~ * `android:delay`指定子元素開始動畫的時間延遲,如果元素入場的時間周期為300ms,那么`android:delay="0.5"`就表示150ms。 * `android:animationOrder`指定子元素的動畫順序,有三種取值,`normal`表示順序出現,`reverse`表示反序,`random`表示隨機。 * `android:interpolator`用來指定后影響動畫的播放速度。 * `android:animation`指定具體的每個子元素的播放動畫,這里指定為一個動畫文件,即:`res/anim/item_anim.xml`文件。 `item_anim.xml`文件內容如下: ~~~ <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:duration="200" android:interpolator="@android:anim/accelerate_decelerate_interpolator" android:shareInterpolator="true" > <alpha android:fromAlpha="0.0" android:toAlpha="1.0"/> <scale android:fromXScale="1" android:toXScale="1.2" android:fromYScale="1" android:toYScale="1.2"/> </set> ~~~ 應用了透明度動畫,從不可見到可見,同時進行了略微的縮放。指定時間為200ms。當然,這里的應用為,直接在布局文件的`ListView`標簽中指定`android:layoutAnimation`: ~~~ <ListView android:id="@+id/list_view" android:layout_width="match_parent" android:layout_height="wrap_content" android:layoutAnimation="@anim/layoutanimation01" android:background="#ffEEEEEE" android:divider="#dddbdb" android:dividerHeight="1dp" /> ~~~ 然后在`Activity`中進行數據裝填即可: ~~~ list_view.adapter = ArrayAdapter<String>( this, android.R.layout.simple_list_item_1, listOf("123", "測試項", "123", "測試項") ) ~~~ 效果為從第一個`item`到最后一個,依次顯現到略微放大的動態效果。`gif`轉化會丟失這個效果,這里就不貼圖了。 # 3. 代碼動態指定 類似的,也可以使用`kotlin`代碼來直接指定,首先在`layoutanimation01.xml`中刪除對應的`android:animation`: ~~~ <?xml version="1.0" encoding="utf-8"?> <layoutAnimation xmlns:android="http://schemas.android.com/apk/res/android" android:delay="0.5" android:animationOrder="normal" android:interpolator="@android:anim/linear_interpolator" > </layoutAnimation> ~~~ 代碼設置: ~~~ val loadAnimation = AnimationUtils.loadAnimation(this, R.anim.item_anim) val layoutAnimationController = LayoutAnimationController(loadAnimation) layoutAnimationController.delay = 0.5f layoutAnimationController.order = LayoutAnimationController.ORDER_NORMAL list_view.layoutAnimation = layoutAnimationController list_view.adapter = ArrayAdapter<String>( this, android.R.layout.simple_list_item_1, listOf("123", "測試項", "123", "測試項") ) ~~~
                  <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>

                              哎呀哎呀视频在线观看