开发者

Android Hide RelativeLayout Completely

I want to hide a relative layout completely. i have a view with several Layouts i use as buttons with an onClickListener. Now i want to display only those Buttons that i want because sometimes an Object doesnt have all Data. I tried to 开发者_开发问答set visiblity to "4" wich should be "gone" but that didnt do the trick. there still is space reserved for this Layout. What can i do about this?

Thank you.


RelativeLayout.setVisibility(View.GONE);


You should set it to View.GONE which is 8 not 4


to hide:

RelativeLayout.setVisibility(View.INVISIBLE);

to show it again:

RelativeLayout.setVisibility(View.VISIBLE);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜