ViewPager in ScrollView

I ran into a similar problem in the past. A View-Pager must have a set height (it cannot wrap-content). Since a ViewPager loads separate pages, and not all at once, it won’t know what ‘wrap-content’ actually means. Setting the layout_height to fill_parent or a set dp allows the ViewPager to statically set it’s height and … Read more

Stop ScrollView from auto-scrolling to an EditText

After struggling with that problem for quite some time, I’ve found a solution that seems to work without being too ugly. First, make sure that whatever ViewGroup (directly) contains your EditText has descendantFocusability set to “Before Descendants,” focusable set to “true” and focusableInTouchMode set to “true.” This will not be the ScrollView itself, but the … Read more

Disable ScrollView action

This might be a bit late but I ran into the same problem so my solution is similar to above, had to disable the OnTouchListener as follows: // Get the ScrollView final ScrollView myScroll = (ScrollView) findViewById(R.id.display_scrollview); // Disable Scrolling by setting up an OnTouchListener to do nothing myScroll.setOnTouchListener( new OnTouchListener(){ @Override public boolean onTouch(View … Read more

UIScrollView doesn’t scroll after upgrading to iOS7 / xcode 5

I solved this by deselecting ‘Use Autolayout’ in the File Inspector pane of main view within the Scroll View. If you want to keep ‘Autolayout’ enabled, try ‘Editor -> Reslove Autolayout Issues -> Add Missing Constraints’. The key constraint appears to be ‘Bottom Space to: Superview and in my case was -300, giving 300 scroll … Read more

How to disable and enable the scrolling on android ScrollView? [duplicate]

Try this way Create Your CustomScrollview like this import android.content.Context; import android.util.AttributeSet; import android.view.MotionEvent; import android.widget.ScrollView; public class CustomScrollView extends ScrollView { private boolean enableScrolling = true; public boolean isEnableScrolling() { return enableScrolling; } public void setEnableScrolling(boolean enableScrolling) { this.enableScrolling = enableScrolling; } public CustomScrollView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } … Read more

Android: Detecting When ScrollView Hits Bottom [duplicate]

Try this: @Override protected void onScrollChanged(int l, int t, int oldl, int oldt) { // Grab the last child placed in the ScrollView, we need it to determinate the bottom position. View view = (View) getChildAt(getChildCount()-1); // Calculate the scrolldiff int diff = (view.getBottom()-(getHeight()+getScrollY())); // if diff is zero, then the bottom has been reached … Read more

ScrollView doesn’t scroll to the bottom

The problem is android:layout_margin=”10dp” in RelativeLayout of SrcollView Replace <RelativeLayout android:layout_width=”match_parent” android:layout_height=”wrap_content” android:layout_margin=”10dp”> with <RelativeLayout android:layout_width=”match_parent” android:layout_height=”wrap_content” android:padding=”10dp” >