我有一个带有一些元素(A、B 和 C)的 LinearLayout:
-------
| A |
+-----+
| B |
+-----+
| C |
-------
并且一开始 B 是 GONE (View.GONE),但是当用户按下 A 时,B 会显示动画:
public static LayoutAnimationController getLayoutAnimation_slideDownFromTop(Context ctx) {
AnimationSet set = new AnimationSet(true);
Animation animation = new AlphaAnimation(0.0f, 1.0f);
animation.setDuration(100);
set.addAnimation(animation);
animation = new TranslateAnimation(
Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f,
Animation.RELATIVE_TO_SELF, -1.0f, Animation.RELATIVE_TO_SELF, 0.0f
);
animation.setDuration(300);
set.addAnimation(animation);
LayoutAnimationController controller = new LayoutAnimationController(set, 0f);
return controller;
}
视图 B 是动画属性,但视图 C 只是跳到最后,我想知道是否有一种标准方法可以使 B 和 C 动画同时向下滑动