Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between removing a view and setting it's visibility as GONE?

What is the difference between removing a view from it's parent and setting it's visibility as GONE?

like image 281
Sreejith Karumanaghat Avatar asked Oct 21 '25 06:10

Sreejith Karumanaghat


1 Answers

If you remove a view from the parent, its no longer in its list of children. You can then add it to any other ViewGroup. If you loop through the old paren't children it won't come up, and it won't be called when the ViewGroup does things like resize itself.

If you make it GONE, its still a child of the ViewGroup. It can't be added to another, because it can have only 1 parent. It will still be called for things like resizing of the view group.

like image 69
Gabe Sechan Avatar answered Oct 24 '25 05:10

Gabe Sechan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!