etilia etilia - 1 year ago 158
Android Question

Android AlertDialog button positioning

I have a requirement to create an

, which is split vertically into two zones:

  1. One of these zones (on the right side) should have dialog buttons (OK, Cancel and Set) at the bottom and another layout on top of these buttons.

  2. Left side of this dialog should have another layout, say, image.

The question is, is it possible to have anything like that or all alertDialogs have to have all their buttons at the bottom? I don't even know where to start. I've tried looking at
class, but could see anything suitable.

Answer Source

it looks like you don't need an AlertDialog for this, but yes you can do it with AlertDialog. create your view and then use AlertDialog.Builder without calling setPositiveButton(), setNegativeButton() etc..

AlertDialog alertDialog = new AlertDialog.Builder(context)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download