纵向使用摄像头 [英] Using Camera in Portrait Orientation

查看:178
本文介绍了纵向使用摄像头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想开发一个应用程序,它使用相机。到目前为止,它一直运作良好,但我不能强迫方向为纵向。它似乎运作良好,如果我强迫所有的活动,以山水,因为相机preVIEW似乎适合风景线。

I'm trying to develop an app which uses the Camera. So far it's been working well, except that I'm unable to force the orientation to be "portrait". It seems to work well if I force all activities to "landscape", because the camera preview seems to fit in landscape.

反正是有使用相机在人像模式?

Is there anyway to use the Camera in portrait mode?

推荐答案

Android设备V2.2及以上遏制和API来旋转显示为纵向。低于2.2设备仅景观。最好的办法是,以检测设备是2.2和旋转90度。在2.2依傍山水的设备。好消息是大多数Android设备都在2.2以上。

Android devices v2.2 and above contain and API to rotate the display to portrait. Devices below 2.2 are landscape only. Your best bet is to detect if the device is 2.2 and rotate 90 degrees. Fall back on landscape for devices under 2.2. The good news is most Android devices are on 2.2 and above.

看看我的答案在这里更多的信息:

Check out my answer here for more info:

<一个href="http://stackoverflow.com/questions/5504605/camera-is-wrong-unless-keyboard-is-open/5504651#5504651">Camera是错误的,除非键盘打开

这篇关于纵向使用摄像头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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