dimanche 17 juillet 2016

In AlertDialog buttons being shown in the vertical orientation

buildToolsVersion "23.0.3"

targetSdkVersion 23

When I tried to add 3 buttons on my android.support.v7.app.AlertDialog, buttons being shown in the vertical orientation (and not in horinzontal). It is a bug ?

Here is my code :

new AlertDialog.Builder(context)
                .setMessage("My message")
                .setPositiveButton("Positive Button", new DialogInterface.OnClickListener()
                {
                    @Override
                    public void onClick(DialogInterface dialog, int which)
                    {

                    }
                })
                .setNegativeButton("Negative Button", new DialogInterface.OnClickListener()
                {
                    @Override
                    public void onClick(DialogInterface dialog, int which)
                    {

                    }
                })
                .setNeutralButton("Neutral Button", new DialogInterface.OnClickListener()
                {
                    @Override
                    public void onClick(DialogInterface dialog, int which)
                    {

                    }
                })
                .show();

enter image description here

Aucun commentaire:

Enregistrer un commentaire