0
我有一個3頁的介紹。 我使用本教程,以實現刷卡頁面簡介: https://thepseudocoder.wordpress.com/2011/10/05/android-page-swiping-using-viewpager/android viewpager與圖像不匹配
這工作正常,但:
我的第一頁有一個圖像和文本。我的第二和第三頁只有文字沒有圖像。
如果我從頁面1滑動到頁面2或從2滑動到1,幻燈片動畫將會滯後。
現在,我發現了一個「解決方案」 如果我從網頁中刪除圖片1 =沒有滯後 與圖像=滯後
我的第一個網頁看起來是這樣的:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
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:id="@+id/Page1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/txt"
android:id="@+id/txt" />
<ImageView
android:id="@+id/imageView3"
android:layout_gravity="center"
android:background="@drawable/image"
android:layout_width="183dp"
android:layout_height="281dp"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true" />
</RelativeLayout>
你的圖像大小是多少? – Gauthier
原始尺寸:640 x 987 px – Stack108
現在呢? :( – Stack108