Control the visibility of Android TextView at runtime programmatically

In my Java Android application, at runtime, as per the condition, I need to set the visible value to false in the TextView. How to make it run programmatically?

+7
source share
1 answer

You are looking for the setVisibility method in View .

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

It does not take boolean because you can set it to either Invisible or Gone. If he left, he will not occupy any “space” in the layout.

+35
source

Source: https://habr.com/ru/post/898301/


All Articles