0
判定我有兩個FrameLayout
小號相互重疊的底部(讓我們稱之爲layout_front
和layout_back
,其中每個佈局具有多個文字和圖像視圖)。最初layout_back
的可見度將消失。動畫布局到的另一佈局,其距離在運行時
我想要什麼來實現:當我想layout_back
顯示,我將它設置爲可見的,並且我希望動畫layout_front滑落到layout_back的底部。效果就像我有兩張「卡片」,滑下前面的卡片在後面顯示另一張卡片。
問題:第一個明顯的方式做到這一點是由layout_front
這樣創建動畫的xml:
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="400"
android:fillAfter="true"
android:fromYDelta="0%"
android:toYDelta="100%" />
</set>
1)我的第一個問題是,在layout_front
不會動畫完成後,留在了那裏,但翻譯後立即回到原來的位置。我應該怎麼做才能讓在滑下後留在?
2)我的第二個問題更嚴重。 layout_front
滑動的距離(這是layout_back
的高度)直到運行時才確定。有沒有辦法動態設置YDelta的值?