使用自定義的影片,定義在app/src/main/res/values/styles.xml中,影片全部為:
<style name="popup_window_animation_vertical" parent="android:Animation">
<item name="android:windowEnterAnimation">@anim/push_bottom_in</item>
<item name="android:windowExitAnimation">@anim/push_bottom_out</item>
</style>
其中入場影片為push_bottom_in,關于入場影片的代碼如下:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="300"
android:fromYDelta="100%p"
android:toYDelta="0" />
</set>
然后我在Popupwindow中設定影片:
setAnimationStyle(R.style.popup_window_animation_vertical);
在不斷的測驗中發現,影片確實是從底部向上出現的。(如果不設定此影片Popupwindow便不會出現動態出入的效果,驗證了我的影片是生效的)。但是我嘗試修改入場影片中的“android:duration”,無論怎么修改轉場影片的時長都沒有實際改變該轉場影片的時長。
uj5u.com熱心網友回復:
我使用的android studio版本4.1.3,測驗手機是android9.0的華為nova2s,使用了AndroidX的依賴。轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/279060.html
標籤:Android
上一篇:appium unittest的print()在pycharm的控制臺不顯示log輸出
下一篇:求問圖片相關
