0
私は女の子のファッションカテゴリを表示するアプリを開発しています。私はグリッドビューでカテゴリを表示しようとしました。しかし、私はアプリをテストすると、私はそれをスクロールしながらグリッドビューが壊れています。私のコードは以下のとおりです。これで私を助けてください。前もって感謝します。GridViewはスクロール中に壊れていますか?
single_item.xml
<?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="10dp"
android:orientation="vertical"
android:gravity="center">
<ImageView
android:layout_width="150dp"
android:layout_height="150dp"
android:id="@+id/grid_image"/>
<TextView
android:maxLines="1"
android:layout_marginTop="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/grid_text"
android:textColor="#000"
android:textSize="20sp"
android:gravity="center"/>
</LinearLayout>
と
activity_browse.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="vertical"
tools:context="com.example.user.beautyworld.BrowseActivity">
<GridView
android:id="@+id/grid_view"
android:layout_width="match_parent"
android:padding="10dp"
android:numColumns="auto_fit"
android:gravity="center"
android:columnWidth="150dp"
android:layout_height="match_parent">
</GridView>
</LinearLayout>
まだ私は問題に直面しています –