Search This Blog

Friday, November 11, 2011

Android change dialog width; Android set width of a custom Dialog

When one creates custom dialogs in Android there is a problem with setting the width of the dialog to fill the entire available space. I described custom dialog creation here. This sample shows how to set the width of the custom dialogs in Android:

loginDialog.getWindow().getAttributes().width = LayoutParams.FILL_PARENT;

OR

loginDialog.getWindow().setLayout(600, 400);

9 comments:

  1. This is one of the good quality post.I am so happy by read your blog details.This is one of the enjoyable post.
    Android app developers

    ReplyDelete
  2. I got a good entertainment to visit your blog, becasue its having the lots of interesting information and to providing the good timing.

    ReplyDelete
  3. perfect! thanks for the tip!

    ReplyDelete
  4. i have searched many sites but i have not found it ,thanks for posting this...

    ReplyDelete
  5. Wow!!grt bolg yar!!

    ReplyDelete
  6. when using fragments, write this code inside the onCreate() method.

    ReplyDelete

If you like this post, please leave a comment :)