I am trying to achieve scrolling of layout by overriding onScroll method of Gesture Listener
@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2,
float distanceX, float distanceY) {
Log.d("Scroll"," X " + this.get +" Y " + this.getScrollY() );
// this- Relative Layout
this.scrollBy((int)distanceX,(int)distanceY);
invalidate();
return false;
}
With the above code I am able to scroll the layout but my layout's background is moving out of bound i.e. screen ? How will I limit it ? I tried various thing by getScrolly() , getLeft() but i am not getting any link by which I can go ahead ? please help me ...