有什么区别的B / W View.GONE和View.INVISIBLE [英] what is difference b/w View.GONE and View.INVISIBLE

查看:239
本文介绍了有什么区别的B / W View.GONE和View.INVISIBLE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是自定义视图。
  在自定义视图我绘制了一些图形。而且我使用我的布局TextView的。当我提出这个TextView的有形和无形的按钮点击
,它是清除graph.Why它清除图形既走了,看不见?

I am using a Custom View. On the Custom View I am plotting some Graph. And also I am using TextView on my layout. When I am making this TextView VISIBLE and INVISIBLE on button click , it is clearing graph.Why it is clearing graph with both GONE and INVISIBLE?

任何想法?

推荐答案

了解更多关于<一个href=\"http://stackoverflow.com/questions/11556607/android-difference-between-invisible-and-gone\">Android :?无形匆匆差异

可以说

View.GONE 这种观点是不可见的,并且它不承担任何空间
  布局的目的。

View.GONE This view is invisible, and it doesn't take any space for layout purposes.

View.INVISIBLE 这个观点是无形的,但它仍然占用空间布局的目的。

View.INVISIBLE This view is invisible, but it still takes up space for layout purposes.

让清晰与一些图片的想法。


Lets clear the idea with some pictures.

假设你有三个按钮,如下面

现在,如果你设定按钮的可见性两成无形的( View.INVISIBLE ),那么输出将是

Now if you set visibility of Button Two as invisible (View.INVISIBLE), then output will be

当你设置两个按钮的可视性不见了( View.GONE ),那么输出将是

And when you set visibility of Button Two as gone (View.GONE) then output will be

希望这会清除你的疑虑​​。

Hope this will clear your doubts.

这篇关于有什么区别的B / W View.GONE和View.INVISIBLE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆