viewPager.setPadding(30,0,30,0);
viewpager的内容是从
here
.
所以问题是,每当我从viewpager缩放布局时,唯一可见的缩放是在顶部和底部。由于填充,缩放在左右两侧不可见。
缩放前的屏幕截图
这些是我试过的代码片段
活动读取程序.xml
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:id="@+id/reader_pager"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#000"/>
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/zoom_layout">
android:id="@+id/img_holder"
android:transitionName="pager"
android:background="#FFF"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
android:id="@+id/page_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:srcCompat="@drawable/a_four"
android:layout_weight="1"
android:scaleType="fitXY"
/>
缩放视图后,当我松开手指时,视图应平滑地移动到全屏显示页面。