在我的应用程序中,我创建的自定义对话框没有完整的高度,我不能改变和自定义它。例如,看到这个屏幕截图:
我的代码:
final Dialog contacts_dialog = new Dialog(ActivityGroup.this, R.style.theme_sms_receive_dialog);
contacts_dialog.setContentView(R.layout.dialog_schedule_date_time);
contacts_dialog.setCancelable(true);
contacts_dialog.setCanceledOnTouchOutside(true);
contacts_dialog.show();
布局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layoutRoot"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@null"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_header_dialog_background"
android:orientation="horizontal"
android:padding="4dp" >
<TextView
android:id="@+id/TextView21"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginRight="5dp"
android:layout_weight="2"
android:gravity="center_vertical|right"
android:text="@string/choose_schedule_time_date"
android:textColor="#ffffff"
android:textSize="14sp"
android:textStyle="bold" />
<ImageView
android:id="@+id/ImageView03"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginTop="0dp"
android:background="@drawable/icon_scudule_time" />
</LinearLayout>
</LinearLayout>
风格:
<style name="theme_sms_receive_dialog" parent="android:style/Theme.Dialog">
<item name="android:windowNoTitle">true</item>
<item name="android:background">@android:color/transparent</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="numberPickerStyle">@style/NPWidget.Holo.Light.NumberPicker</item>
</style>