1

I currently developing an app with different card, which are include in a NestedScollView. But if i don't put an attribute minHeight on the CardView nothing appair.

XML

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:card_view="http://schemas.android.com/apk/res-auto"
    xmlns:app="http://schemas.android.com/tools"
    card_view:cardPreventCornerOverlap="false"
    card_view:cardUseCompatPadding="true"
    card_view:cardElevation="8dp"
    android:layout_margin="5dp"
    android:layout_below="@+id/emptyView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:clipToPadding="false"
    app:clipChildren="false">

        <android.support.percent.PercentRelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <com.weezyu.utils.custom.widget.RalewayTextView
                style="@style/WeezyuTheme.TextView"
                android:id="@+id/activitiesTitle"
                android:gravity="left|center_vertical"
                android:text="Activities"
                android:textColor="#88000000"
                android:paddingLeft="20dp"
                android:layout_height="0dp"
                android:layout_width="0dp"
                card_view:layout_widthPercent="100%"
                card_view:layout_heightPercent="10%"/>

            <android.support.v7.widget.RecyclerView
                android:id="@+id/activitiesList"
                android:layout_below="@id/activitiesTitle"
                android:layout_height="0dp"
                android:layout_width="0dp"
                card_view:layout_widthPercent="100%"
                card_view:layout_heightPercent="80%"/>

            <com.weezyu.utils.custom.widget.RalewayTextView
                style="@style/WeezyuTheme.TextView"
                android:id="@+id/activitiesAdd"
                android:layout_below="@+id/activitiesList"
                android:text="Show More"
                android:textColor="#88000000"
                android:clickable="true"
                android:background="?android:attr/selectableItemBackground"
                android:layout_height="0dp"
                android:layout_width="0dp"
                card_view:layout_widthPercent="100%"
                card_view:layout_heightPercent="10%" />
        </android.support.percent.PercentRelativeLayout>
</android.support.v7.widget.CardView>

EDIT: wrap_content on PercentRelativeLayout don't work

Onik
  • 19,396
  • 14
  • 68
  • 91
Raphael Teyssandier
  • 1,722
  • 2
  • 13
  • 25

0 Answers0