调整对话框占用更多的屏幕 [英] Resize dialog to take up more screen

查看:130
本文介绍了调整对话框占用更多的屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个布局的setContentView的对话框。我在布局中设置宽度的EDITTEXT和按钮来匹配父,但是这使得它只能作为宽的的setTitle。当我输入信息到EDITTEXT,对话与每个字符扩展。是有可能使该对话框类似于下面不设置DP尺寸的物品的宽度?一些系统标准?

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 dialog 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?

推荐答案

在大多数情况下,对话是太小表明您正在使用 FILL_PARENT 而不是 WRAP_CONTENT (或 match_parent )。

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

您会认为 FILL_PARENT 最终总是比 WRAP_CONTENT 更大,但是这不是EditTexts的情况。

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

此外,考虑使用的android:minEms 为您的EditText

Also, consider using android:minEms for your EditText.

这篇关于调整对话框占用更多的屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆