I have a LinearLayout containing two TextViews. I want the height of the LinearLayout to be fluid. When one of them is hidden, it should collapse to the height of the only visible Textview. I have specified the layout_height of the LinearLayout to "wrap_content" and set the visibility to invisible in the XML file. When I run the app, the layout is still the original size. Any ideas?
Thanks
If possible paste your xml file.
And insted of setting visibility to invisible use setVisibility(View.GONE);
If I understand your question correctly, what you want to do is change the visibility to gone. A "gone" view will cause the others to behave as if it had never been added.
Reference: http://developer.android.com/reference/android/view/View.html#attr_android:visibility
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With