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的更多相关文章

  1. 关于android:screenOrientation="portrait"等

    1.android:screenOrientation="portrait",表示当切换横竖屏的时候,屏幕的内容始终以竖屏显示,而不会根据屏幕的方向来显示内容. 2.插入个Andr ...

  2. 关于android:screenOrientation="portrait" 横竖屏切换

    当在AndroidManifest.xml文件中定义了android:screenOrientation="portrait",就表示当我们切换横竖屏的时候,屏幕的内容始终以竖屏显 ...

  3. android:screenOrientation属性

    今天工作中发现一个activity的android:screenOrientation属性设置为behind,平时经常看到的是landscape.portrait,一时没有反应过来,故查了一下andr ...

  4. android:screenOrientation的说明

    在Android的官方文档当中,对android:screenOrientation的说明如下: http://www.cnblogs.com/snowberg/archive/2012/07/15/ ...

  5. 43、android:screenOrientation

    android:screenOrientationThe orientation of the activity's display on the device. The value can be a ...

  6. 横竖屏切换android:screenOrientation属性的使用

    在开发android的应用中,有时候需要限制横竖屏切换,只需要在AndroidManifest.xml文件中加入android:screenOrientation属性限制.    android:sc ...

  7. android:screenOrientation的说明 固定屏幕显示方向

    Activity在屏幕当中显示的方向.属性值可以是下表中列出的一个值: "unspecified" 默认值,由系统来选择方向.它的使用策略,以及由于选择时特定的上下文环境,可能会因 ...

  8. Android中Activity运行时屏幕方向与显示方式详解

    现在我们的手机一般都内置有方向感应器,手机屏幕会根据所处位置自动进行横竖屏切换(前提是未锁定屏幕方向).但有时我们的应用程序仅限在横屏或者竖屏状态下才可以运行,此时我们需要锁定该程序Activity运 ...

  9. Android之常见问题集锦Ⅰ

     Android中如何在ViewPager中使动态创建的ImageView铺满屏幕 最近在做东西的时候,有一个要求,就是把用于在ViewPager里面轮播的图片铺满屏幕,但是中间遇到的问题是,Imag ...

随机推荐

  1. 【Linux学习】Ubuntu下嵌入式交叉编译环境arm-linux-gcc搭建

    (1)首先选择一个路径用来存放arm-linux-gcc.我选用的是/home/book,并在以下建立一个目录arm-linux-gcc. (2)利用cp EABI-4.3.3_Emdedsky_20 ...

  2. hosts文件的路径

    在windows中,hosts文件的路径为:C:\Windows\System32\drivers\etc 在Linux中,hosts文件的路径为:/etc/hosts

  3. 制作U盘启动盘(以CentOS6.3为例)

    借助UltraISO(软碟通),自己百度下载一个即可(同样适用于制作Windows启动盘). 选择文件→打开,选择ISO镜像所在目录,如下两幅图所示:

  4. I - Doing Homework again

    I - Doing Homework again Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & ...

  5. 使用VisualStudio发布ASP.NET网站

    1.右击网站点击“发布网站” 2.选择或导入发布配置文件.→新建配置文件. 3.输入名称test.→点击确定. 4.发布方法选择文件系统. 5.选择目标位置.→点击下一步 6.文件发布选项选择三个选项 ...

  6. String的构造函数、析构函数和赋值函数

    编写类String的构造函数.析构函数和赋值函数 已知类String的原型为: class String { public: String(const char *str = NULL); // 普通 ...

  7. c++ 学习笔记(常见问题与困惑)(转载)

    本问转自: http://www.cnblogs.com/maowang1991/p/3290321.html 1.struct成员默认访问方式是public,而 class默认访问方式是privat ...

  8. smarty如何处理状态值的显示

    比如状态,有效或者无效.这个数据库中保存的是1或者2这样的字段. 显示在列表的时候不能是1或者2吧. 以前,我都是在后台foreach,处理的.感觉处理之后,前台就不灵活了.这个值就被替换成了文字. ...

  9. c++ - fcgio.cpp:50: error: 'EOF' was not declared in this scope - Stack Overflow

    c++ - fcgio.cpp:50: error: 'EOF' was not declared in this scope - Stack Overflow fcgio.cpp:50: error ...

  10. UVA-Matrix Chain Multiplication(栈)

     Matrix Chain Multiplication  Suppose you have to evaluate an expression like A*B*C*D*E where A,B,C, ...