Answer the question
In order to leave comments, you need to log in
Why does ImageView position reset when switching ViewPager?
there is such markup
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent"
>
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.v4.view.ViewPager>
<ImageView
android:layout_centerInParent="true"
android:id="@+id/touchImg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/robo"
android:scaleType="center" />
</RelativeLayout>
mViewPager.setCurrentItem(mViewPager.getCurrentItem()+1,true);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question