从库中打开图像只有在Potrait模式 [英] Open Image from Gallery Only in Potrait mode
本文介绍了从库中打开图像只有在Potrait模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要建一个应用程序,它会从库中打开图像。图像被成功打开,但我想知道我是否可以强制在纵向模式下打开的形象呢?
这是我使用的意图:
意向意图=新的意图(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(文件),图像/ *);
intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
startActivity(意向);
解决方案
使用安卓screenOrientation =画像
在清单中的每个<活动/>
标记......它会工作......我friend..try它
I'm building an app which will open an image from gallery. The image is opened successfully but I would like to know if I can force the image to be opened in portrait mode?
This is the Intent I'm using :
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file),"image/*");
intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
startActivity(intent);
解决方案
use android:screenOrientation="portrait"
in manifest in each <activity/>
tag...it will work...my friend..try it
这篇关于从库中打开图像只有在Potrait模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文