需要在AndroidManifest
中添加活动的screenOrientation
属性!
示例代码
<activity
android:name=".ControlActivity"
android:label="控制界面"
android:screenOrientation="landscape"
>
</activity>
对了,还需要声明的一件事,你也许会发现,
这个不是能直接改成横屏嘛!
但是跑进真机一看,你就傻眼了,不是那回事啊!
事实上,这里Design
的lanscape
只是为了设计布局好看,真正起作用的是在AndroidManifest
中设置的screenOrientation