创建一个popwindow 并动态设置pop的高度 限定pop高度
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/bithday_layout_lin"
android:background="@color/white">
<TextView
android:id="@+id/choose_txt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="13dip"
android:text="选择病例"
android:gravity="center"
android:layout_centerInParent="true"
android:textColor="@color/text_color_959595"
android:textSize="@dimen/text_size_22px" />
<View
android:layout_width="match_parent"
android:layout_height="0.5dip"
android:layout_below="@+id/choose_txt"
android:background="@color/text_color_cccccc" />
</RelativeLayout>
<LinearLayout
android:id="@+id/bithday_layout_lin"
android:layout_width="match_parent"
android:layout_above="@+id/bithday_layout1"
android:background="@color/white"
android:layout_height="wrap_content">
<ListView
android:id="@+id/bithday_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:divider="@color/text_color_cccccc"
android:dividerHeight="0.1dp" />
</LinearLayout>
<View
android:id="@+id/bithday_layout1"
android:layout_width="match_parent"
android:layout_height="10dip"
android:layout_above="@+id/layout_cancel"
android:background="#f2f5f7" />
<LinearLayout
android:id="@+id/layout_cancel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:background="@color/white"
android:gravity="center"
android:orientation="horizontal">
<Button
android:id="@+id/btn_cancel"
android:layout_width="match_parent"
android:layout_height="@dimen/height50"
android:background="@drawable/freeclinics_btn_click_bg"
android:gravity="center"
android:text="取 消"
android:textColor="@color/content"
android:textSize="@dimen/text_size_20px" />
</LinearLayout>
</RelativeLayout>