Dialog.setTitle zeigt nicht einen Titel

Ich versuche, fügen Sie einen benutzerdefinierten Titel zu meinem Dialog, aber wenn ich meine Anwendung ist es nicht zeigen, ein Titel.

Mein code zum erstellen der dialog ist

 final Dialog passwordDialog = new Dialog(this);
 passwordDialog.setContentView(R.layout.admin_password_dialog);
 passwordDialog.setTitle("Enter An Administrative Password");
 passwordDialog.show();

Und meine layout-Datei

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

<Button
    android:id="@+id/btn_confirmPassword"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentEnd="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentRight="true"
    android:layout_alignParentStart="true"
    android:layout_below="@+id/edit_adminPassword"
    android:layout_marginLeft="10dp"
    android:layout_marginRight="10dp"
    android:text="@string/confirmPassword"/>

<EditText
    android:id="@+id/edit_adminPassword"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentEnd="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentRight="true"
    android:layout_alignParentStart="true"
    android:layout_alignParentTop="true"
    android:layout_marginLeft="10dp"
    android:layout_marginRight="10dp"
    android:ems="10"
    android:inputType="textPassword"/>

Und hier ist, was ich bekommen

Dialog.setTitle zeigt nicht einen Titel

Gibt es etwas, was ich bin fehlt?

stackoverflow.com/questions/4852573/... ist das vielleicht ein workaround

InformationsquelleAutor Ryan Newman | 2016-02-09

Schreibe einen Kommentar