android screenOrientation
Activity:
android:screenOrientation 横(landscape)竖(portrait)屏显示。
如果想让它一直是横屏显示的话,xml:android:screenOrientation="landscape",
如果想让它一直是竖屏显示的话,xml:android:screenOrientation="portrait",
注:横竖屏切换后Activity会重新执行onCreat函数,但是在Android工程的Mainfest.xml中加入
android:screenOrientation="user" android:configChanges="orientation|keyboardHidden"之后,
横竖屏切换之后就不会去执行OnCreat函数了,而是会去调用onConfigurationChanged(),
这样我们就能控制横竖屏的切换了。或者在res目录下建立layout-land和layout-port目录,
相应的layout文件不变。layout-land是横屏的layout,layout-port是竖屏的layout。
android screenOrientation的更多相关文章
- 关于android:screenOrientation="portrait"等
1.android:screenOrientation="portrait",表示当切换横竖屏的时候,屏幕的内容始终以竖屏显示,而不会根据屏幕的方向来显示内容. 2.插入个Andr ...
- 关于android:screenOrientation="portrait" 横竖屏切换
当在AndroidManifest.xml文件中定义了android:screenOrientation="portrait",就表示当我们切换横竖屏的时候,屏幕的内容始终以竖屏显 ...
- android:screenOrientation属性
今天工作中发现一个activity的android:screenOrientation属性设置为behind,平时经常看到的是landscape.portrait,一时没有反应过来,故查了一下andr ...
- android:screenOrientation的说明
在Android的官方文档当中,对android:screenOrientation的说明如下: http://www.cnblogs.com/snowberg/archive/2012/07/15/ ...
- 43、android:screenOrientation
android:screenOrientationThe orientation of the activity's display on the device. The value can be a ...
- 横竖屏切换android:screenOrientation属性的使用
在开发android的应用中,有时候需要限制横竖屏切换,只需要在AndroidManifest.xml文件中加入android:screenOrientation属性限制. android:sc ...
- android:screenOrientation的说明 固定屏幕显示方向
Activity在屏幕当中显示的方向.属性值可以是下表中列出的一个值: "unspecified" 默认值,由系统来选择方向.它的使用策略,以及由于选择时特定的上下文环境,可能会因 ...
- Android中Activity运行时屏幕方向与显示方式详解
现在我们的手机一般都内置有方向感应器,手机屏幕会根据所处位置自动进行横竖屏切换(前提是未锁定屏幕方向).但有时我们的应用程序仅限在横屏或者竖屏状态下才可以运行,此时我们需要锁定该程序Activity运 ...
- Android之常见问题集锦Ⅰ
Android中如何在ViewPager中使动态创建的ImageView铺满屏幕 最近在做东西的时候,有一个要求,就是把用于在ViewPager里面轮播的图片铺满屏幕,但是中间遇到的问题是,Imag ...
随机推荐
- iptables 配置
#查看iptables现有规则 iptables -L -n #先允许所有,不然可能悲剧 iptables -P INPUT ACCEPT #清除所有默认规则 iptables -F #清除自定义规则 ...
- sql中复合组建解析
每个表只能有一个主键 唯一键/约束可以多个 复合主键是指复合唯一,比如: 1 1 1 2 2 1 2 2 单看任何一列都不是唯一,但组合起来就是唯一的. Create Table 表名 (字段名1 I ...
- C++/C#结构体转化-传string给C++
此例是把C#结构传给C++ C++: typedef struct VidyoClientInEventGroupChat_ { /*! Message (contents) to be sent t ...
- BZOJ 2245: [SDOI2011]工作安排( 费用流 )
费用流模板题..限制一下不同愤怒值的工作数就可以了. ------------------------------------------------------------------------- ...
- Java 注解机制
一.注解中的信息已经在Class中了,我们应该如何读取出来 java.lang.reflect.AnnotatedElement接口: public Annotation[] getAnnotatio ...
- mysql 的not null 与 null的区别(转,恍然大悟)
相信很多用了mysql很久的人,对这两个字段属性的概念还不是很清楚,一般会有以下疑问: 1.我字段类型是not null,为什么我可以插入空值 2.为毛not null的效率比null高 3.判断字段 ...
- hdu 3518 Boring counting 后缀数组
题目链接 根据height数组的性质分组计算. #include <iostream> #include <vector> #include <cstdio> #i ...
- Spring起步(一)Building a RESTful Web Service
http://spring.io/guides/gs/rest-service/ 先放链接. 这个很小很小的一个功课,我却遇到了各种各样的奇葩错误,折腾了两天才弄好. 想要开始的话,需要一些准备工具 ...
- 编程习题——Maximum Subarray
Find the contiguous subarray within an array (containing at least one number) which has the largest ...
- Git-常用命令集合
该文章会陆续添加内容,学习网页来自http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000 ...