【发布时间】:2018-02-08 06:30:04
【问题描述】:
我经历过
TranslateAnimation (float fromXDelta, float toXDelta, float fromYDelta, float toYDelta)
但我仍然对Translate animation 的工作原理感到困惑。
有人可以解释一下它是如何工作的吗?我读了文档说
fromXDelta Change in X coordinate to apply at the start of the animation
toXDelta Change in X coordinate to apply at the end of the animation
fromYDelta Change in Y coordinate to apply at the start of the animation
toYDelta Change in Y coordinate to apply at the end of the animation
但我仍然不清楚它是如何工作的。
编辑:我有一个Button 和一个LinearLayout,没有任何孩子。当我单击Button 时,我想动态生成一个TextView 并为TextView 设置动画以显示在LinearLayout 中。 TextViews 的数量取决于按钮的点击次数。
【问题讨论】:
-
你的意思是说,你首先有一个小按钮,你想让它足够大(拉伸)到一个确定的位置,点击它?
-
@Hiral 不,当我们单击第一个按钮时会有两个按钮,第二个按钮将可见并动画到一个点。
-
请检查我的更新答案!