Custom Alert dialog not centered vertically on Android -


I created a custom gesture dialog box to display at the end of my game so that by entering my name to save the player Could it be The problem is that when I call show on the call, but it is not vertical centered! It is a bit less and it does not matter which properties I set in XML or when using setGravity ()

I think this is the same problem But nobody gave a proper answer.

Thank you for your help.

For more information, here is my code:

  AlertDialog.builder Builder; Layout Inflight Inflight = (Layout Inflator) This .getSystemService (LAYOUT_INFLATER_SERVICE); View Layout - inflater.inflate (R.layout.newrecord, Find ViewById (R.layout.shoot)); Builder = New AlertDialog Builder (this); Builder.setView (layout); NewRecDialog = Builder.Create ();  

And here is the code of the first element of the XML layout of newrecord.xml :

  & lt; LinearLayout xmlns: Android = "http://schemas.android.com/apk/res/android" Android: Orientation = "Vertical" Android: layout_height = "fill_parent" Android: layout_width = "fill_parent" Android: gravity = "center" Android: Padding = "10dp" Android: Baseline Alliance = "True" & gt;  

This output is a screenshot:

A bug is described. AlertDiagogue is reserved for title / icon panel, where there is no title nor icon

OK, I think, is quite simple: it should only be set to the top panel layout, just like there is no such button for button button unless it is done , Is the only way to implement only its own Dialogue subclass.


Comments