Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make the title and positive/negative buttons black in an Alert Dialog
    primarykey
    data
    text
    <p>My current Alert Dialog looks like the one of the right, I want it to look like the one on the left.</p> <p><img src="https://i.stack.imgur.com/21AqN.png" alt="enter image description here"></p> <p>I think I can do that by changing the theme of the custom Dialog, but I am not sure if that is correct, and if it is so, then how to proceed? Is there anyway I can customly change the positive/negative button?</p> <p>I dont want to create my custom dialog as the way the button show in alert dialog is perfect for me.</p> <p>Something like the one on the right in <a href="http://developer.android.com/guide/topics/ui/dialogs.html" rel="nofollow noreferrer">http://developer.android.com/guide/topics/ui/dialogs.html</a></p> <p>This is what I have done so far,</p> <pre><code> AlertDialog.Builder builder = new AlertDialog.Builder(LoginSignupActivity.this); LayoutInflater inflater = getLayoutInflater(); builder.setView(inflater.inflate(R.layout.newusersignup, null)).setTitle("Sign up"); builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {} //etc </code></pre> <p>and my xml looks like </p> <pre><code>&lt;TextView android:id="@+id/newUsersTxtName" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:text="Enter your name" android:textColor="@color/white" android:textAppearance="?android:attr/textAppearanceSmall" /&gt; &lt;TextView android:id="@+id/newUserTxtPassword" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_below="@+id/newUsersName" android:text="Enter password" android:textColor="@color/white" /&gt; &lt;EditText android:id="@+id/newUsersName" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_below="@+id/newUsersTxtName" android:ems="10" android:textColor="@color/white" android:inputType="text" &gt; &lt;requestFocus /&gt; &lt;/EditText&gt; &lt;EditText android:id="@+id/newUserPassword" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_below="@+id/newUserTxtPassword" android:ems="10" android:textColor="@color/white" android:inputType="textPassword" /&gt; &lt;EditText android:id="@+id/newUserEmail" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_below="@+id/newUserTxtEmail" android:ems="10" android:textColor="@color/white" android:inputType="textEmailAddress" /&gt; &lt;TextView android:id="@+id/newUserTxtEmail" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_below="@+id/newUserPassword" android:text="Enter your email" android:textColor="@color/white" android:textAppearance="?android:attr/textAppearanceSmall" /&gt; </code></pre> <p></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload