Balvonas
Balvonas

Reputation: 189

Android disable a screen element but not have a gap

If i set a Screen element to be invisible in a "LinearLayout", i do anyway have a gap instead of it. How to make gap a disappear along with a element?

Thanks

Upvotes: 0

Views: 51

Answers (3)

MAC
MAC

Reputation: 15847

When you set view to invisible then your View will be still there just disappears but occupies its space while you use gone this will remove your view

this will solve your problem

view.setVisibility(View.GONE);

Upvotes: 5

Dmitriy Tarasov
Dmitriy Tarasov

Reputation: 1969

Use view.setVisibility(View.GONE)

Upvotes: 0

Aerilys
Aerilys

Reputation: 1639

Have you tried to put the "Visible" attribute to "Gone" ?

Upvotes: 0

Related Questions