Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个打开相机的活动。我正在使用 framelayout 进行相机预览。但是我必须以纵向模式打开相机,这会产生很多问题,例如小屏幕,旋转问题,即使我的活动处于纵向模式,我可以将我的框架布局设置为横向吗
或者如果有任何在人像模式下有效打开相机的想法将不胜感激
提前致谢
在 API 级别 8 (v2.2) 中,Camera 包含一个名为 setDisplayOrientation 的方法。使用 90 调用此方法可将相机显示旋转到纵向模式。
尝试编辑您的 AndroidManifest.xml 的活动声明:
<Activity android:screenOrientation="landscape" ... />