如何在 android 上将相机方向锁定为纵向

How to set camera orientation locked to portrait on android

我正在使用 this scan library 构建扫描仪应用程序,如何在库代码中设置方向以将相机方向锁定为纵向?我试过了 setting camera orientation to portrait not working

不要使用第三方库

https://developer.android.com/guide/topics/media/camera

您可以使用官方 android 文档来了解如何使用,然后应用您从其他链接获得的内容。如果您想编辑和裁剪,您可以在这些链接中找到更多信息:

How to crop and rotate image programmatically in android?

Android: Edit image intent