如何创建视图存根?
我是 android 新手..我的 xml 中有一个滑块。对于滑块的特定值,我希望出现一个图像,然后消失。我听说 View Stub 可以做到这一点。但没有完全得到解决方案。任何人都可以帮助我吗?
谢谢, 克尔蒂拉吉
I am new to android.. I have a slider in my xml. For the particular value of the slider I want an Image to appear and later disappear.. I heard that View Stub can do the trick.. But not exactly getting the solution.. Can any one please help me..
Thanks,
Keerthiraj
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ViewStub
用于当您有一个隐藏但稍后可能会显示的“重”视图时。ViewStub
是一个轻量级视图,当真实视图可见时,它会在运行时膨胀真实视图。所以
ViewStub
不能解决您的问题。我认为最适合您的解决方案是设置ImageView
的可见性:ViewStub
is used when you have a "heavy" view which is hidden but may be shown later.ViewStub
is a light-weight view which inflates the real view at run-time when it's made visible.So
ViewStub
doesn't solve your problem. I thinks the best solution for you is to setImageView
's visibility: