0
私はカードビューで画像を表示するためにこのレイアウトを持っています。カードビューでスクロールして、アンドロイド素材デザインのギャップを作る
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent"
android:padding="16dp"
>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/cv"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
>
<ImageView
android:id="@+id/thumbnail"
android:layout_width="100dip"
android:layout_height="100dip"
android:adjustViewBounds="true"
android:scaleType="fitXY" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
画面が読み込まれるとすべてが完璧に見えます。しかし、画面上をスクロールすると、2つのグリッドの間に垂直方向のギャップができます。ギャップの大きさは画面の高さに等しい。結果として、スクロール後に画面上に2グリッドしか表示されません。
この現象はなぜですか?これを修正する方法は?
こちらを参考にしてください。 http://stackoverflow.com/questions/36782333/gap-between-cardviews-increases-on-scrolling –
どのようにスクロールしているのか教えていただけますか?それはLIstまたはリサイクルビューか一部のScrollViewですか? –