0
点赞
收藏
分享

微信扫一扫

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


目录

全屏
标题栏
横竖屏

全屏

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

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

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

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

标题栏

方式一:在manifest中写入

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

方式二:在activity中写入

requestWindowFeature(Window.FEATURE_NO_TITLE);

横竖屏

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

横屏

"landscape"

竖屏

"portrait"


举报

相关推荐

0 条评论