Theme.Dialog创建过小的屏幕 [英] Theme.Dialog creates too small screen

查看:142
本文介绍了Theme.Dialog创建过小的屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有ListView中,有一个活动:

I have an activity with ListView that has:

android:theme="@android:style/Theme.Dialog"

在清单。
当我打开它,并当它只有一个在的ListView线,打开的窗口中是非常小的。
怎样使窗口取整屏?

in Manifest. When I open it and when it has only one line in ListView, the window that opens is very small. How do I make the window take the whole screen?

推荐答案

使用这个在你活动的onCreate方法,使全屏幕。

Use this in your onCreate method of the Activity to make it full screen.

   @Override
protected void onCreate(Bundle arg0) {
    super.onCreate(arg0);
    setContentView(R.layout.myxml);

    LayoutParams params = getWindow().getAttributes(); 
            params.height = LayoutParams.MATCH_PARENT;
            params.width  = LayoutParams.MATCH_PARENT;
           getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
   } 

这篇关于Theme.Dialog创建过小的屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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