Scroll Content Size

I have a ScrollView and I set the large tree image to ScrollView and set 15 ImageView each branch using RelativeLayout .

My problem is that when receiving an image only 10, then ImageView should see only 10, and the remaining 5 should be hidden. From 1 to 10 images, the bottom of the screen should be displayed one after another, and scrolling only scrolling up should not drop after 10 images.

Right now, for example, if you see 8 for 8 ImageViews at the bottom of the screen, and if you get a snapshot of 6 for 6 images at the bottom, and after the 7th, the 8th is hidden at the bottom of the screen, but its scrolling. which must be stopped.

Here is my code:

  Display display = getWindowManager().getDefaultDisplay(); final int height = display.getHeight(); //get screen height // Log.e("width , hight od screen",""+height); Rect r=locateView(finalViewList.get(finalViewList.size()-1)); // get image position on scroll view final int touchY = (r.bottom); lastPos = touchY - height; // scview.scrollTo(0, lastPos); //set scroll view 

Scrolling is set at the bottom, starting from the 10th ImageView , but the ScrollView scrolls down and can display an empty 11th view of the image. Suppose I hide eleven ImageViews, then an empty branch is displayed, which should not be displayed.

+4
source share

All Articles