Mein Artikel Layout ist wie folgt:Gridview letzte Zeile abgeschnitten
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical"
android:paddingBottom="16dp"
android:gravity="center">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/iv"
android:adjustViewBounds="true"
android:src="@drawable/linianzhenti"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/tv"
android:layout_marginTop="8dp"
android:text="aaa"
android:textSize="16sp"/>
Und dann ist mein Haupt Layout:
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/grey"
android:orientation="vertical">
...
...
<com.kumakitty.wenquanedu.MyGridView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:horizontalSpacing="16dp"
android:id="@+id/gridhome2"
android:numColumns="2">
</com.kumakitty.wenquanedu.MyGridView>
</LinearLayout>
Hier MyGridView.class :
public class MyGridView extends GridView {
public MyGridView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public MyGridView(Context context) {
super(context);
}
public MyGridView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int mExpandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
super.onMeasure(widthMeasureSpec, mExpandSpec);
}
}
Bilder wurden mit ImageLoader angezeigt Ich denke, es kann durch die verschiedenen Höhen der Bilder verursacht werden Wie kann ich es lösen? Jede Hilfe wird geschätzt :) Und bitte entschuldigen Sie meine schlechte Englisch OTL
aber RecyclerView braucht api 21 oder höher, rechts gibt es bei vielen Menschen mit Geräten laufen Andriod 4.XX – Kumakitty
Es ist erhältlich? abwärtskompatible Support-Bibliothek. Sie können den folgenden Link https://developer.android.com/topic/libraries/support-library/features.html#v7-appcompat einsehen –