打开另一个意图时如何设置烤面包的方向? [英] how to set toast orientation while opened in another intent?

查看:104
本文介绍了打开另一个意图时如何设置烤面包的方向?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨我正在使用内置的android相机:

Hi I'm using built in android camera:

android.media.action.IMAGE_CAPTURE

android.media.action.IMAGE_CAPTURE

我要实现的目标是,在打开相机电源后使TOAST出现.

and what I'm trying to achieve, is make a TOAST appear after turning the camera on.

烤面包机工作正常,但始终以横向模式显示.有趣的是,在开始用IMAGE_CAPTURE调用意图之前,先开始烘烤面包,然后烘烤面包片刻以正确的方向显示,但是随后进入相机模式后,它将自动切换到横向模式.

The toast works fine, but it always shows in landscape mode. What's funny, I'm starting the toast before calling the intent with IMAGE_CAPTURE, and the toast for few moments shows in proper orientation, but then after turning into camera mode, it automatically flips to the landscape mode.

由于我的应用程序的想法,我希望它仅在PORTRAIT模式下显示.

Because of the idea of my application, I would like it to show only in PORTRAIT mode.

有人知道如何强迫烤面包定向吗?

Does anyone have an idea how to force toast orientation ?

推荐答案

我非常怀疑您是否可以通过标准的toast实现来实现这一目标.方向是通过当前活动为整个系统设置的.视图层次结构中的所有内容都将继承当前方向.

I very much doubt you will be able to achieve this with the standard toast implementation. The orientation is set for the whole system by the current activity. Everything that is part of the view hierarchy will inherit the current orientation.

这篇关于打开另一个意图时如何设置烤面包的方向?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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