T
T
tolsor2018-04-30 18:09:39
Java
tolsor, 2018-04-30 18:09:39

How to hide an element so it doesn't take up space?

On the web, there are two CSS properties for hiding elements: and . In the first case, the invisible element does not take up space on the page; in the second case, it does. What are the similar properties in Android? Attributes and ? display: none;visibility: hidden;
android:display="none"android:visibility="hidden"

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilya, 2018-04-30
@tolsor

android:visibility="invisible"andandroid:visibility="gone"

L
lahomie93, 2018-05-01
@lahomie93

Clarification: to hide the View-object so that it "does not take up space" it is necessary to select exactly android:visibility="gone". With android:visibility="invisible" an empty space will be visible on the screen, where the disappeared object used to be

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question