Shu*_*ham 5 android android-animation android-layout
如何为从中移动的布局设置动画
左到右
点击按钮.最初它应该是不可见的,但在按钮点击它应该从左方向出来覆盖屏幕
您将需要布置视图的xml,以便在其最后阶段显示它.然后将可见性设置为已消失.然后,您将创建一个TranslateAnimation
TranslateAnimation anim = new TranslateAnimation(-100f, 0f, 0f, 0f); // might need to review the docs
anim.setDuration(1000); // set how long you want the animation
ViewYouWantToAnimate.setAnimation(anim);
ViewYouWantToAnimate.setVisibility(View.VISIBLE);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7571 次 |
| 最近记录: |