如果你想改变cardview的大小而不是根据文本大小而不是改变android:layout_height="wrap_content"
<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/cardview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
card_view:cardCornerRadius="0dp"
card_view:cardElevation="1.5dp">
EX:我试过了
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/cardview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
card_view:cardBackgroundColor="#85c7dc"
card_view:cardCornerRadius="0dp"
card_view:cardElevation="1.5dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:weightSum="2">
<TextView
android:id="@+id/txtDrVisit_DrName"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="ABC"
android:textSize="25sp"
android:textStyle="bold" />
<TextView
android:id="@+id/txtDrVisit_DrDetails"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="ABC"
android:textSize="45sp"
android:textStyle="normal" />
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>