如何在设置View的alpha之前创建1秒的延迟?
在我的应用程序中,我将在一个动画之后设置 alpha。 就像:
hideMenu = AnimationUtils.loadAnimation( getApplication(), R.anim.menu_layout_hide);
menuLayout.startAnimation(hideMenu);
menuLayout.setVisibility(View.GONE);
但我想在 Alpha 设置视图之前设置 1 秒的延迟。因此,我无法看到该布局的动画。那么怎么可能呢?
谢谢。
In My Application i am going to set the alpha after one animation.
As like:
hideMenu = AnimationUtils.loadAnimation( getApplication(), R.anim.menu_layout_hide);
menuLayout.startAnimation(hideMenu);
menuLayout.setVisibility(View.GONE);
But i want to set the delay of 1 Sec before the Alpha set th the View. as Because of that i am not able to see the Animation of that layout. So How it is possibe ?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
在动画
xml
文件中,您可以使用android:startOffset
属性:In your animation
xml
file you can useandroid:startOffset
attribute:你不能使用
在你的动画xml中?
请参阅动画资源文档。
Can't you use the
in your animation xml?
See the animation resource documentation.
假设您使用的是 view .animate() 方法,您可以设置起始偏移量:
Suppose you are using the view
.animate()
method, you can set the start offset:Handler 是实现这一目标的好技术。
Handler is a good technique to achieve this.
在您的情况下,您可以简单地这样做
在这种情况下,您可以动态控制活动的开始时间值
In your case you can simply do like this
In this case you can control dynamically value of the start time from the activity