相机仅在横向模式下
我在我的应用程序中启动相机,
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);
我只想在横向模式下预览相机,而不是纵向模式。请告诉我如何实现这一目标?
I am starting camera in my application as ,
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);
I want camera preview only in landscape mode not in portrait. Please tell me how to achieve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不,如果您使用内置相机应用程序,则无法实现此目的,因为相机应用程序的清单定义了
android:screenOrientation="landscape"
这意味着相机应用程序将始终在横向模式。如果你真的想达到你的目标,你可以直接使用相机类,但这会带来很多额外的工作
No, you can't achieve this if you are using the built-in camera app because the manifest of camera app defines
android:screenOrientation="landscape"
which means that camera app will always show the camera in landscape mode.You can directly use camera class if you really want to achieve your goal but it will be a lot of extra work
据我所知,您不可能为此制作自定义相机应用程序并将您的活动修复为横向模式。
AFAIK it is not possible you have to make custom camera application for this and fix your activity to landscape mode.