您的位置:首页 > 移动开发 > Android开发

Android的全屏、标题栏、横竖屏设置

2015-08-19 19:33 330 查看

目录

全屏

标题栏

横竖屏

全屏

方式一:在manifest中设置theme为NoTitleBar.Fullscreen

[code]android:theme="@android:style/Theme.NoTitleBar.Fullscreen"


方式二:在Activity 中写入以下两句话,注意要写在setContentView之前

[code]this.requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);


标题栏

方式一:在manifest中写入

[code]android:theme="@android:style/Theme.NoTitleBar"


方式二:在activity中写入

[code]requestWindowFeature(Window.FEATURE_NO_TITLE);


横竖屏

横竖屏设置利用screenOrientation属性,在manifest中进行设置

横屏

[code]  android:screenOrientation="landscape"


竖屏

[code]  android:screenOrientation="portrait"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: