Ich brauche eine 3-spalte gridview mit gridline in einem Projekt. Also, ich habe ein Ergebnis;Wie kann ich 3 Spalten gridline für responsive XML setzen
Dies ist Anmerkung 3 Ergebnis (5.7" und Version "4.4.2"); http://i.imgur.com/fkkKOWE.jpg
Dies ist Anmerkung 5 Ergebnis (5.7" und Version "Android M"); http://i.imgur.com/6JFlSdf.jpg
Hier meine Codes; fragment_homepage.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<GridView
android:id="@+id/GVHomepage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:numColumns="3"
android:verticalSpacing="1dp"
android:horizontalSpacing="1dp"
android:background="#edf2f8" />
<ProgressBar
android:id="@+id/PBLoading"
style="?android:attr/progressBarStyleInverse"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
</RelativeLayout>
</LinearLayout>
categories_row.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center">
<RelativeLayout
android:layout_width="120dp"
android:layout_height="120dp"
android:background="#fff">
<TextView
android:id="@+id/TVCategoryName"
android:layout_marginTop="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Yiyecek"
android:textSize="16sp"
android:textStyle="bold"
android:textColor="#745f87"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceSmall" />
<ImageView
android:id="@+id/IVCategoryPhoto"
android:layout_width="70dp"
android:layout_height="70dp"
android:scaleType="fitCenter"
android:layout_marginTop="10dp"
android:layout_centerHorizontal="true"
android:layout_below="@+id/TVCategoryName"
android:src="@mipmap/ic_launcher"/>
</RelativeLayout>
</LinearLayout>
So, wie ich das Ergebnis wie die "Note 3" auf allen Bildschirmauflösungen bekommen?
Überprüfen Sie meinen geposteten Code. Es wird für Sie arbeiten. –