private void findScrollView ( ViewGroup viewGroup ) { scrollChild = viewGroup ; if ( viewGroup . getChildCount ( ) > 0 ) { int count = viewGroup . getChildCount ( ) ; View child ; for ( int i = 0 ; i < count ; i ++ ) { child = viewGroup . getChildAt ( i ) ; if ( child instanceof AbsListView || child instanceof ScrollView || child instanceof ViewPager || child instanceof WebView ) { scrollChild = child ; return ; } } } }
Find out the scrollable child view from a ViewGroup .