是否与方向的宽度和高度的变化? [英] Does the Width and Height change with orientation?

查看:125
本文介绍了是否与方向的宽度和高度的变化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我的游戏垂直方向开始,然后最终进入到水平方向。我知道屏幕的宽度是画面的宽度和高度相同,当它在垂直方向。当切换到水平方向并高度成为宽度和宽度变的高度?或者他们保持不变?

So my game starts in Vertical orientation and then eventually goes to Horizontal orientation. I know that the width of the screen is the width of the screen and the same with height when it is in Vertical orientation. When it switches to Horizontal orientation does the Height become the Width and the Width becomes the Height? Or do they stay the same?

推荐答案

是屏幕的宽度,并根据设备方向的高度变化。你可以用 Display.getSize(点如雷贯耳)这是去precated方法得到更换显示器的尺寸 Display.getHeight Display.getWidth 。从文档:<一href=\"http://developer.android.com/reference/android/view/Display.html#getSize%28android.graphics.Point%29\"相对=nofollow>这个值是基于显示器的当前旋转调整为要。

Yes the screen width and height change depending on the device orientation. You can get the size of a display with Display.getSize(Point outSize) which is a replacement for the deprecated methods Display.getHeight and Display.getWidth. From the docs: This value is adjusted for you based on the current rotation of the display.

这篇关于是否与方向的宽度和高度的变化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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