So I am aware that I can’t use ListView inside ScrollView, because ScrollView gets the focus in that case and ListView becomes non-scrollable. But I have a program that goes out of screen when in landscape mode and I need to be able to scroll down to see the rest of the program so I use LinearLayout(vertical) with ScrollView that contains the most of the program and under that ScrollView I got my ListView. Now I want to be able to scroll down to my ListView when I am in landscape mode but it won’t let me do that, it stops me where ListView begins. Is there a some kind of solution for this, or is it better for me to make my program stay in portrait mode?
So I am aware that I can’t use ListView inside ScrollView , because ScrollView
Share
You are still trying to nest a ListView inside a ScrollView in landscape mode…
I suggest creating a new landscape specific layout with two columns: the left hand side contains UI elements inside the ScrollView and the right hand side contains the ListView. This way both Views will still support scrolling.
Simply save this new layout in a new folder
res/layout-landwith the same file name as the portrait layout inres/layout. The OS will automatically switch layouts when the orientation changes.You can read more about this: Supporting Different Screens
This end result will be similar to the old Google Market image:
The left, green side can scroll if necessary and the right, white side will scroll as well.