Can I scroll a ScrollView programmatically in Android?

The answer from Pragna does not work always, try this: mScrollView.post(new Runnable() { public void run() { mScrollView.scrollTo(0, mScrollView.getBottom()); } }); or mScrollView.post(new Runnable() { public void run() { mScrollView.fullScroll(mScrollView.FOCUS_DOWN); } }); if You want to scroll to start mScrollView.post(new Runnable() { public void run() { mScrollView.fullScroll(mScrollView.FOCUS_UP); } });

Dynamic height viewpager

Made a few tweaks in your code and it is working fine now. 1] onMeasure function wasn’t proper. Use below logic @Override public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { if (mCurrentView == null) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); return; } int height = 0; mCurrentView.measure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)); int h = mCurrentView.getMeasuredHeight(); if (h > height) height = … Read more

Recyclerview inside ScrollView not scrolling smoothly

Try doing: RecyclerView v = (RecyclerView) findViewById(…); v.setNestedScrollingEnabled(false); As an alternative, you can modify your layout using the support design library. I guess your current layout is something like: <ScrollView > <LinearLayout > <View > <!– upper content –> <RecyclerView > <!– with custom layoutmanager –> </LinearLayout > </ScrollView > You can modify that to: … Read more

How can I make my layout scroll both horizontally and vertically?

I was able to find a simple way to achieve both scrolling behaviors. Here is the xml for it: <ScrollView xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:scrollbars=”vertical”> <HorizontalScrollView android:layout_width=”320px” android:layout_height=”fill_parent”> <TableLayout android:id=”@+id/linlay” android:layout_width=”320px” android:layout_height=”fill_parent” android:stretchColumns=”1″ android:background=”#000000″/> </HorizontalScrollView> </ScrollView>