开发者

Resize dialog to take up more screen

开发者 https://www.devze.com 2023-02-22 18:37 出处:网络
I have a dialog that setContentView on a layout. I have an editText and Button in the layout set width to match parent but that makes it only as wide as the setTitle. As I enter info into the editText

I have a dialog that setContentView on a layout. I have an editText and Button in the layout set width to match parent but that makes it only as wide as the setTitle. As I enter info into the editText, the dialo开发者_高级运维g expands with each character. Is it possible to make the dialog look like below without setting a dp size for the width of the items? Some system standard?

Resize dialog to take up more screen


In most cases, a dialog being too small indicates that you're using fill_parent instead of wrap_content (or match_parent).

You would think that fill_parent always ends up larger than wrap_content, but that's not the case with EditTexts.

Also, consider using android:minEms for your EditText.

0

精彩评论

暂无评论...
验证码 换一张
取 消