0

Bitte vollständig lesen - Nun, ich weiß nicht, was hier falsch gelaufen ist. Jeder der CardView Bottom ist nicht zu seinem Elternteil.android: cardView width stimmt nicht mit dem übergeordneten überein

Ich versuche Hintergrund RecyclerView hinzuzufügen und transparenten Hintergrund CardView

custom_row-Code zu machen -

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
xmlns:card_view="http://schemas.android.com/apk/res-auto" 
android:layout_width="match_parent" 
android:layout_height="wrap_content"> 

<android.support.v7.widget.CardView 
    android:id="@+id/cardView" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:foreground="?android:attr/selectableItemBackground" 
    card_view:cardCornerRadius="@dimen/card_album_radius"> 

    <RelativeLayout 
     android:layout_width="wrap_content" 
     android:layout_height="match_parent" 
     android:paddingBottom="7.5dp" 
     android:paddingTop="7.5dp"> 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_centerVertical="true" 
      android:orientation="horizontal"> 

      <RelativeLayout 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="10dp"> 

       <com.makeramen.roundedimageview.RoundedImageView 
        android:id="@+id/imageView1" 
        android:layout_width="45dp" 
        android:layout_height="45dp" 
        android:layout_alignParentLeft="true" 
        android:layout_alignParentStart="true" 
        android:layout_alignParentTop="true" 
        android:layout_centerInParent="true" 
        android:src="@drawable/ic_action_movie" /> 

      </RelativeLayout> 

      <LinearLayout 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginBottom="8dp" 
       android:layout_marginTop="8dp" 
       android:layout_weight="0.75" 
       android:orientation="vertical"> 

       <TextView 
        android:id="@+id/playList_name" 
        android:layout_width="240dp" 
        android:layout_height="match_parent" 
        android:layout_alignParentLeft="true" 
        android:layout_alignParentTop="true" 
        android:layout_marginLeft="16dp" 
        android:ellipsize="end" 
        android:maxLines="1" 
        android:text="SongName" 
        android:textAppearance="@style/Base.TextAppearance.AppCompat.Title" 
        android:textColor="#c1c1c1" 
        android:textSize="16sp" /> 

       <TextView 
        android:id="@+id/album_artist" 
        android:layout_width="240dp" 
        android:layout_height="wrap_content" 
        android:layout_below="@id/playList_name" 
        android:layout_marginLeft="16dp" 
        android:layout_weight="0.25" 
        android:ellipsize="end" 
        android:maxLines="1" 
        android:text="ARTIST" 
        android:textColor="#a1a1a1" 
        android:textIsSelectable="false" 
        android:textSize="12sp" /> 


      </LinearLayout> 

      <ImageView 
       android:id="@+id/my_overflow" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_alignParentRight="true" 
       android:layout_centerVertical="true" 
       android:layout_weight="1.4" 
       android:paddingRight="16dp" 
       android:scaleType="fitEnd" 
       android:src="@drawable/ic_grade" /> 

     </LinearLayout> 

    </RelativeLayout> 

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

Und hier ist song_fragment.xml -

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
tools:context="com.example.ansh.albums.Fragments.Songs"> 

<android.support.v7.widget.RecyclerView 
    android:id="@+id/recyclerview" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 
</android.support.v7.widget.RecyclerView> 

Hier ist das Ergebnis, das ich habe - image

Ich weiß nicht, warum jeder der cardView nicht, um es passend ist unten Mutterbreite?

Bitte helfen.!

+0

versuchen Höhe auf 0 innerhalb cardView Einstellung – Aditi

+0

Es hat @Aditi nicht geholfen –

+0

Sie Karte Höhe oder Breite entsprechen? Sie wollen nicht die Trennlinie zwischen den Karten? – Max

Antwort

0

können Sie verwenden, versuchen, diese Fahrt des unteren Teiler zu erhalten

<android.support.v7.widget.CardView 
    xmlns:card_view="http://schemas.android.com/apk/res-auto" 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:id="@+id/cv" 
    card_view:cardElevation="0dp" 
    card_view:cardMaxElevation="0dp" 
    card_view:cardPreventCornerOverlap="false"> 
+0

Cheers ..! Bud :) Jetzt funktioniert es. –