如何设置Android的XML全屏 [英] How to set XML fullscreen in Android
问题描述
我如何在XML irregardless创建一个全屏模式多么小里面有什么内容?
How do I create a full screen mode in XML irregardless of how small what contents are in it?
下面是我的show.xmlcode:
Here's my "show.xml" code:
<LinearLayout android:orientation="vertical"
android:layout_height="wrap_content" android:layout_width="fill_parent"
android:layout_gravity="center">
<Button android:id="@+id/ok_btn" android:layout_height="fill_parent"
android:layout_width="fill_parent" android:typeface="sans" android:text="ok"></Button>
</LinearLayout>
我要像另一个全屏页面显示出来,与黑色的背景,就像一个main.xml中。在这种情况下,它像一个弹出屏幕。删除或更改了android:layout_width和android:layout_heigh不起作用。请帮助! (
I want to display it like another full screen page, with black background, like a main.xml. In this case, its like a pop-up screen. Removing or changing the android:layout_width and android:layout_heigh don't work. help please! :(
推荐答案
据我所知,你不能做全屏XML格式。你有两个选择:
Afaik you cant do fullscreen in xml. You have two choices:
1)在AndroidManifest.xml中活动的部分。
1) AndroidManifest.xml in activity's section
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
2)中的onCreate()的code
2) in the code in onCreate()
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
这篇关于如何设置Android的XML全屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!