I have an Activity
which contains 3 Fragment
s. And all the 3 Fragment
s have ListView
in them.
I would like to know how to display the 3 Fragment
s in the ScrollView
in same Activity
?
Please let me know the solution.
Thanks.
I have an Activity
which contains 3 Fragment
s. And all the 3 Fragment
s have ListView
in them.
I would like to know how to display the 3 Fragment
s in the ScrollView
in same Activity
?
Please let me know the solution.
Thanks.
So I think the the right user experience here is to have only 1 scrolling view, the basic scroll view. The List Views in the fragment should then expanded to take as much space as they need.
The way I accomplished this was to override onMeasure like this
@Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (MeasureSpec.getMode(heightMeasureSpec) == MeasureSpec.UNSPECIFIED) {
/**
* Putting things which like to be scrolled into scrolling views causes bad behavior.
*
* The goal here is to simply trick the List view into believing it should fill all available
* space rather than being undefined.
*/
heightMeasureSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
}
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
This way you have the 1 scrollable view, and you have 3 expanded list views.