自定义活动对话框在Nexus5上显示为奇怪

时间:2014-02-17 17:18:32

标签: android android-studio android-linearlayout

Android Studio 0.4.5

您好,

在Nexus5上运行时,

活动对话框显示很有趣。 enter image description here

但是,在Nexus4 4.4.2仿真器上运行时。 (我没有Nexus5模拟器)。它显示正确。我在正确显示的Acer Z130硬件上进行了测试。

我已经从一个Activity创建了一个Dialog。

minSdkVersion 10
targetSdkVersion 19

我的对话框xml是

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <ImageView
        android:id="@+id/ivRabbitLogo"
        android:layout_width="match_parent"
        android:layout_height="64dp"
        android:scaleType="center"
        android:background="#ff20a3ff"
        android:contentDescription="Logo of App" />

    <EditText
        android:id="@+id/etUpdateDlgName"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:inputType="text"
        android:hint="Name"
        android:textSize="22sp" />

    <EditText
        android:id="@+id/etUpdateDlgPhone"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:inputType="phone"
        android:hint="Phone"
        android:textSize="22sp" />

    <EditText
        android:id="@+id/etUpdateDlgEmail"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:inputType="textEmailAddress"
        android:hint="Email"
        android:textSize="22sp" />

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

        <Button
            android:id="@+id/btnCancel"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Cancel"
            android:textSize="20sp"
            android:layout_weight="1"
            android:onClick="onClickCancel"/>

        <Button
            android:id="@+id/btnSave"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Save"
            android:textSize="20sp"
            android:layout_weight="1"
            android:onClick="onClickUpdate"/>

        <Button
            android:id="@+id/btnDelete"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Delete"
            android:textSize="20sp"
            android:layout_weight="1"
            android:onClick="onClickDelete"/>

    </LinearLayout>
</LinearLayout>

清单文件中的活动:

<activity
    android:theme="@style/dialogStyle"
    android:name="com.ssd.busb.Dialog_update" >
</activity>

我的自定义样式是:                   

<style name="dialogStyle" parent="android:style/Theme.Dialog">
    <item name="android:windowBackground">@null</item>
    <item name="android:windowNoTitle">true</item>
</style>

非常感谢任何建议,

在模拟器Nexus4上显示正确:

0 个答案:

没有答案