Monday, April 9, 2012

Android Dialog with default width

Having trouble making Dialog width to default length? (At least curtain length)

Use MinWidth theme:

final Dialog dialog = new Dialog(this, android.R.style.Theme_Holo_Dialog_MinWidth);
dialog.setContentView(R.layout.main);
dialog.setCancelable(true);
dialog.show();

You can also use: android.R.style.Theme_Holo_Light_Dialog_MinWidth

No comments:

Post a Comment