开发者

Control Android TextView visibility run time programmatically

开发者 https://www.devze.com 2023-04-10 01:13 出处:网络
In my Java Android application, in run time according to a condition I 开发者_StackOverflowneed to setvisible false in a TextView. How to do it run time programmatically?You\'re looking for the setVis

In my Java Android application, in run time according to a condition I 开发者_StackOverflowneed to setvisible false in a TextView. How to do it run time programmatically?


You're looking for the setVisibility method in View.

textView.setVisibility(View.GONE);
textView.setVisibility(View.INVISIBLE);

It doesn't take a boolean because you can set it to either Invisible or Gone. If it's Gone, it will not take up any "space" in the layout.

0

精彩评论

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