固定屏幕显示模式 ScreenOrientation
在学习jetboy代码时,发现屏幕被旋转了,代查代码没有找到相关设置,在manifest.xml中找到了相关的代码:
Java代码
android:versionName="1.0.0">
android:theme="@android:style/Theme.NoTitleBar">
android:screenOrientation="portrait"
>
android:versionName="1.0.0">
android:theme="@android:style/Theme.NoTitleBar">
android:screenOrientation="portrait"
>
找到这名代码:android:screenOrientation="portrait"
portrait表示横向,landscape表示纵向
如果要使Activity的View界面全屏,只需要将最上面的信号栏和Activity的Title栏隐藏掉即可,隐藏Title栏的代码:
requestWindowFeature(Window.FEATURE_NO_TITLE);
配置文件里代码:
android:theme="@android:style/Theme.NoTitleBar"
隐藏信号栏的代码:
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
其它使用:
getWindow().setFlags(WindowManager.LayoutParams.TYPE_STATUS_BAR, WindowManager.LayoutParams.TYPE_STATUS_BAR);
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
