固定屏幕显示模式 ScreenOrientation(转:http://student.csdn.net/space.php?uid=121497&do=blog&id=19188)
来源:互联网 发布:手机剪接视频软件 编辑:程序博客网 时间:2024/05/24 01:12
在学习jetboy代码时,发现屏幕被旋转了,代查代码没有找到相关设置,在manifest.xml中找到了相关的代码:
Java代码
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.jetboy" android:versionCode="1"
android:versionName="1.0.0">
<application android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
<activity android:name=".JetBoy"
android:label="@string/app_name"
android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="4"></uses-sdk>
<!--
<uses-library android:name="android.test.runner" />
<instrumentation
android:name="android.test.InstrumentationTestRunner"
android:targetPackage="com.example.android.jetboy"
android:functionalTest="true" android:label="Jetboy Test All Runner"/>
<uses-permission android:name="android.permission.RUN_INSTRUMENTATION"/>
-->
</manifest>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.jetboy" android:versionCode="1"
android:versionName="1.0.0">
<application android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
<activity android:name=".JetBoy"
android:label="@string/app_name"
android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="4"></uses-sdk>
<!--
<uses-library android:name="android.test.runner" />
<instrumentation
android:name="android.test.InstrumentationTestRunner"
android:targetPackage="com.example.android.jetboy"
android:functionalTest="true" android:label="Jetboy Test All Runner"/>
<uses-permission android:name="android.permission.RUN_INSTRUMENTATION"/>
-->
</manifest>
找到这名代码: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);
- 固定屏幕显示模式 ScreenOrientation(转:http://student.csdn.net/space.php?uid=121497&do=blog&id=19188)
- sizeof 笔记(转自http://student.csdn.net/space.php?uid=43658&do=blog&id=8677)
- 依赖注入(Dependency injection)转自http://student.csdn.net/space.php?uid=706796&do=blog&id=39000
- JAVA连接ORACLE的基本步骤,写在这里做备忘 (参考了http://student.csdn.net/space.php?uid=412909&do=blog&id=33102)
- 分享如何学好C++的一点想法及给初学者的建议(转自:http://student.csdn.net/space.php?uid=41561&do=blog&id=1449)
- 50个c/c++源代码网站(转自http://blog.chinaunix.net/space.php?uid=22830296&do=blog&id=1768388)
- php soap curl rpc 比较(转自http://www.jkqq.net/space.php?uid=27903&do=blog&id=8280)
- vim显示行号、语法高亮、自动缩进的设置 转自:http://blog.chinaunix.net/space.php?uid=20629471&do=blog&cuid=407799
- ORACLE中的物化视图(原文链接http://blog.chinaunix.net/space.php?uid=8329266&do=blog&id=2032099)
- http://student.csdn.net/space.php?do=course&cid=456&ac=detail
- 微分流形与黎曼几何学习笔记(转自http://blog.sciencenet.cn/home.php?mod=space&uid=81613&do=blog&id=333317)
- http://blog.chinaunix.net/space.php?uid=22028566&do=blog&frmd=71047&view=me wanshilin
- vim tab总结 http://blog.chinaunix.net/space.php?uid=16444831&do=blog&cuid=1137430
- 转帖:MTK平台输入法浅析(转自:http://www.study-bbs.com/uhome/space.php?uid=120578&do=blog&id=2363)
- setuid函数的学习笔记 转自:http://blog.chinaunix.net/space.php?uid=1877180&do=blog&cuid=1132108
- http://student.csdn.net/space.php?do=course&cid=757&ac=detail
- 计算机中的原码、补码和反码 http://blog.chinaunix.net/space.php?uid=7451264&do=blog&cuid=302122
- http://blog.chinaunix.net/xmlrpc.php?r=blog/article&uid=22891521&id=2109284
- 增加部署在Tomcat 6.0中的Java web的运行库
- 单实例设计模式的实现
- request 使用时遇到的问题
- LINUX命令
- Java 5.0 中增强的for循环
- 固定屏幕显示模式 ScreenOrientation(转:http://student.csdn.net/space.php?uid=121497&do=blog&id=19188)
- 告别 Windows Live Spaces
- DataGrid没有数据但是还是显示标头
- ArcGIS Android API 0.1 内部预览版
- Visual Studio中使用宏来添加注释
- 配置dwr2.0框架步骤:
- CWinThread类,以及和createthread API的区别
- 生成一个不重复的随机数组
- csv到html文件的转换