<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sowsceo.rnadomsows"> <application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:supportsRtl="true"
android:theme="@style/AppTheme"
>
<activity
android:name=".MainActivity"
android:launchMode="singleTask"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".produce.ActivityRandom" />
</application>
</manifest>

强制每个activity的横屏或纵屏,也就是说,当用户设置手机可以“自动旋转”时,对于已经强制横屏或纵屏的界面无效,

问题:如何让activiy的界面强制呢!

解答:

  在AndroidManifest.xml文件中,对<activity></activity>进行设置  

 <activity android:name=".produce.ActivityRandom"
android:launchMode="singleTask"
android:screenOrientation="landscape"/> launchMode/screenOrientation 两种参数的设置,缺一不可 android:launchMode="singleTask"
参数说明,详细点击它 http://2960629.blog.51cto.com/2950629/701227 android:screenOrientation="landscape"
landscape是横向,portrait是纵向

【风马一族_Android】强制activity的横屏与纵屏的更多相关文章

  1. 【风马一族_Android】通过菜单的点击,跳转到不同界面

    ---恢复内容开始--- 布局的代码:activity_main.xml <?xml version="1.0" encoding="utf-8"?> ...

  2. 【风马一族_Android】无线连接|调试Android手机

    原文来自:http://www.cnblogs.com/sows/p/6269396.html   (博客园的)风马一族 侵犯版本,后果自负 2017-01-10 15:03:31 准备阶段 1. 软 ...

  3. 【风马一族_Android】多选按钮的监控事件

    import android.app.Activity; import android.os.Bundle; import android.text.TextUtils; import android ...

  4. 【风马一族_Android】第4章Android常用基本控件

    第4章Android常用基本控件 控件是Android用户界面中的一个个组成元素,在介绍它们之前,读者必须了解所有控件的父类View(视图),它好比一个盛放控件的容器. 4.1View类概述 对于一个 ...

  5. 【风马一族_Android】Android 前端内容1

    Android 前端内容 4.1 View 类概述 4.1.1 关于 View //类型说明 view(视图)指的是用户界面组件的基本构建基块.一个视图占据屏幕上的矩形区域,负责绘图和事件处理.视图是 ...

  6. 【风马一族_Android】造作app的效果图

    一.墨刀 官网:https://modao.cc

  7. 【风马一族_Android】手机与电脑通过adb进行连接

    1:打开电脑的命令行 cmd 2:adb devices 查看与电脑连接的手机或模拟器的名称 3:准备要安装的apk.记住手机的名称 4:adb –s <模拟器名称> install  & ...

  8. 【风马一族_Android】让app上传到Android市场的网站介绍

    豌豆荚  开发者中心 http://open.wandoujia.com/account/info China app http://www.chinaapp.org

  9. 【风马一族_Android】Android Studio 给APP设置签名

    在Android Studio中,给App签名,如果没有给App设置签名的话,Android Studio会主动给app设置一个默认的签名 接下来,介绍主动给App设置一个签名的整个步骤过程: 1) ...

随机推荐

  1. ubuntu 11.10 安装apache2 tomcat6

    ubuntu 11.10 安装apache2 tomcat6 导读 Tomcat是Apache 软件基金会(Apache Software Foundation)的Jakarta 项目中的一个核心项目 ...

  2. 构建高性能服务(三)Java高性能缓冲设计 vs Disruptor vs LinkedBlockingQueue--转载

    原文地址:http://maoyidao.iteye.com/blog/1663193 一个仅仅部署在4台服务器上的服务,每秒向Database写入数据超过100万行数据,每分钟产生超过1G的数据.而 ...

  3. 21 Free SEO Tools For Bloggers--reference

    http://dizyne.net/21-free-seo-tools-for-bloggers/ What do you think is important in a website? Yes, ...

  4. 源码-hadoop1.1.0-core-org.apache.hadoop.classification

    里面放着两个注解类:InterfaceAudience和InterfaceStability. InterfaceAudience 类包含三个注解类型,用来被说明被他们注解的类型的潜在的使用范围(au ...

  5. Masonry 布局 cell 高度适应的一种方案(实现类似朋友圈简单布局)

    来源:伯乐在线 - 夏天然后 链接:http://ios.jobbole.com/89298/ 点击 → 申请加入伯乐在线专栏作者 前言: 我模仿的是微博的布局所以也就没有 评论动态刷新cell. 1 ...

  6. Youth(青春)

    Youth is not a time of life; it is a state of mind; it is not a matter of rosy cheeks, red lips and ...

  7. 【Shell脚本学习16】Shell if else语句

    if 语句通过关系运算符判断表达式的真假来决定执行哪个分支.Shell 有三种 if ... else 语句: if ... fi 语句: if ... else ... fi 语句: if ... ...

  8. Oracle基础 (系统工具(export,import)) exp/imp和 (数据泵 (data pump))expdp/impdp的区别:

    一.exp/imp和expdp/impdp在功能上的区别: 1.把用户usera的对象导入到userb emp/imp用法: formuser=usera touser=userb; empdp/im ...

  9. 《UNIX环境高级编程》学习心得 三

    输入和输出 1.文件描述符 文件描述符(file descriptor)可以理解为内核在某个进程中访问一个文件时,内核向进程返回的一个非负整数.在内核使用open或creat打开一个现有文件或者创建一 ...

  10. Python执行系统命令的方法

    Python中执行系统命令常见方法有两种: 两者均需 import os (1) os.system # 仅仅在一个子终端运行系统命令,而不能获取命令执行后的返回信息 system(command) ...