安卓相机翻转

3
我将遵循这个示例。但是,当我将其移植到我的手机上(以便使用相机),预览向左翻转了90度。除此之外,一切都正常运作。
我的问题是:如何“取消翻转”预览? 以下是我的布局文件内容:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="horizontal">   
        <android.view.SurfaceView xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/preview"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent">
    </android.view.SurfaceView> 
</LinearLayout>

此外,当我试图自己旋转手机时,它会保持在“横屏”模式。

提前感谢!


当你说“向左翻转90度”时,是指它最终是竖屏还是横屏? - Will Tate
当你说“flipped”时,你是指“旋转”吗?如果是这样,也许这似乎太明显了,但你的方向中确实有水平。或者我误解了问题! - Kevin
是的,它最终以横向结束。而且无论方向是“水平”还是“垂直”,结果仍然相同。 - whirlwin
1个回答

1

我之前也遇到过同样的问题。我只是添加了一个参数来旋转视图90度。将此参数添加到表面更改函数中:

parameters.setRotation(90); 

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接