如何让android缩放控件像内置缩放控件一样自动消失
我必须改变缩放控件的位置。为此,我使用了 android 缩放控件并在其侦听器中实现了放大和缩小功能。然而,现在我认为它们的行为方式与内置缩放控件相同,即它们自动消失。如何做到这一点,因为我不希望 Android 缩放控件永远保留在屏幕上。
谢谢 阿斯塔
I had to change the position of the zoomcontrols. For this purpose, I used android zoom controls and implemented zoom in and zoom out functions in its listener. However, now i was thinking them to behave in the same manner the built in zoom controls do i.e. they auto disappear. How to do it as i don't want the android zoom control to stay forever on the screen.
Thanks
Astha
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将
AlphaAnimation
应用于小部件,从 1.0(不透明)到 0.0(透明)。每当您希望动画淡出时就启动它。在AlphaAnimation
上设置一个AnimationListener
,以便在动画结束时在小部件上调用setVisibility(View.GONE)
。当您希望小部件重新显示时,请调用setVisibility(View.VISIBLE)
。Apply an
AlphaAnimation
to the widget, going from an alpha of 1.0 (opaque) to 0.0 (transparent). Start the animation whenever you want it to fade out. Set up anAnimationListener
on theAlphaAnimation
to callsetVisibility(View.GONE)
on the widget when the animation ends. When you want the widget to re-appear, callsetVisibility(View.VISIBLE)
.