Android: how to resize a dialog box

I would like to create a dialogue-style form that would fill a large area of ​​the screen (left, right, top, bottom pad 10px).

I defined the "CupCakeDialog" style as follows:

<style name="CupcakeDialog" parent="android:Theme.Dialog"> <item name="android:windowAnimationStyle">@null</item> </style> 

and running the action:

 getWindow().requestFeature(Window.FEATURE_PROGRESS); getWindow().requestFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.ad_popup); 

The dialog is displayed as follows:

alt text http://img199.imageshack.us/img199/1299/popupstackoverflow.png

Does anyone know how to make the dialogue bigger (increase the height)?

Thank!

+1
android layout dialog
Dec 27 '09 at 21:20
source share
2 answers

Since you provide a custom layout for the dialog, you should simply provide the top and bottom padding as usual around the text.

+1
Dec 27 '09 at 22:29
source share

Yes, I'm late, but the answer is here.

 dialog.show(); Display display =((WindowManager)getSystemService(context.WINDOW_SERVICE)).getDefaultDisplay(); int width = display.getWidth(); int height=display.getHeight(); Log.v("width", width+""); dialog.getWindow().setLayout((6*width)/7,(4*height)/5); 

Change the height or width as needed ...

+13
Mar 03 2018-12-12T00:
source share



All Articles