NestedScrollView nested LinearLayout layout cannot fill the full screen

When the elements in the ScrollView want to fill the ScrollView, using "fill_parent" or "match_parent" does not work, you must set the ScrollView: android:fillViewport="true".  

 

   When the ScrollView does not have fillViewport="true", the elements inside (such as LinearLayout) will be calculated according to wrap_content (regardless of whether it is set to "fill_parent" or "match_parent"), and if the element of LinearLayout is set to fill_parent, then it does not work. Yes, because LinearLayout relies on the elements inside, and the elements inside rely on LinearLayout, this is a contradiction. So the element inside is set to fill_parent, and it will be calculated as wrap_content.

Guess you like

Origin blog.csdn.net/guodashen007/article/details/112387608