2016-03-21 2 views

Antwort

0

Fügen Sie wrap_content der Layouthöhe zum übergeordneten Layout hinzu, das cardview enthält. Es wird das Problem lösen. Hier ist ein Ausschnitt, der dir helfen wird.

<LinearLayout 
    android:layout_height="wrap_content" 
    android:layout_width="match_parent" > 

<android.support.v7.widget.CardView 
    xmlns:card_view="http://schemas.android.com/apk/res-auto" 
    android:id="@+id/quote_card" 
    android:layout_height="200dp" 
    android:layout_width="match_parent" 
    card_view:cardBackgroundColor="#666" 
    card_view:cardCornerRadius="5dp" 
    card_view:cardElevation="5dp" 
    app:cardUseCompatPadding="true" 
    > 

    //other views here 


</android.support.v7.widget.CardView> 
</LinearLayout> 
+0

Das hat funktioniert! Vielen Dank. Ich bin mir nicht sicher, warum es vorher funktioniert hat, als ich Höhe als match_parent hatte. – user2792588

+0

akzeptieren Sie dies als Antwort bitte –

Verwandte Themen