Individual design with a height greater than the height of the screen

enter image description here

I want to implement an action with a height exceeding the height of the screen (1.5-2.0). It must be scrollable (up and down). What would be the best layout for implementing this? Any pointers would be helpful. Note. There is already a Scrollview inside the center section. I think Scrollview cannot be root. Will Scrollview work in Scrollview?

+5
source share
1 answer

I don’t know if it will work or not, but you will try it. First remove the visibility of your bottom view, assign onScrollEvent to your ScrollView, as shown

@Override protected void onScrollChanged(int l, int t, int oldl, int oldt) { View view = (View) getChildAt(getChildCount()-1); int diff = (view.getBottom()-(getHeight()+getScrollY()+view.getTop()));// Calculate the scrolldiff if( diff == 0 ){ // if diff is zero, then the bottom has been reached Log.d(ScrollTest.LOG_TAG, "MyScrollView: Bottom has been reached" ); } super.onScrollChanged(l, t, oldl, oldt); } 

this code will detect when the bottom scroll value is reached, when it reaches, makes your bottom visible. Otherwise, it is not displayed programmatically.

the same can be used for viewing from above

0
source

All Articles