Android force 水平(横向)布局 [英] Android force Horizontal (landscape) layout

查看:16
本文介绍了Android force 水平(横向)布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我即将完成我的第一款 Android 游戏,但我遇到了一个非常简单的问题,我相信我会因为不知道如何解决而感到愚蠢,但是我怎么能强迫应用程序保持水平布局?现在,如果你转动手机(模拟器),它会翻转图形并挤压它们.无论用户如何转动手机,我都希望游戏能够水平启动并保持这种状态.

I'm pretty close to finished with my first game for Android, and I've come across a problem that's so simple I'm sure I'll feel stupid for not knowing how to solve it, but how can I force the app to stay in a Horizontal layout? Right now, if you turn the phone (emulator) it flips the graphics and squeezes them. I want the game to start horizontally and stay that way regardless of how the user turns the phone.

谢谢.

推荐答案

打开AndroidManifest.xml,添加如下android:screenOrientation="landscape"例如

Open the AndroidManifest.xml and add the following android:screenOrientation="landscape" e.g.

 <activity android:name=".ActivtyName" 
       android:screenOrientation="landscape"
                >

这篇关于Android force 水平(横向)布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆