简体   繁体   English

如何从应用程序打开Gallery App?

[英]How do you open the Gallery App from an app?

I have an app that takes screenshots and saves them to an album in the iOS gallery app. 我有一个应用程序可以截取屏幕截图并将其保存到iOS画廊应用程序中的相册中。 I want to be able to open the gallery app from my app. 我希望能够从我的应用程序打开图库应用程序。 Is this possible? 这可能吗?

No, sorry not possible. 不,对不起,不可能。 Some apps allow you to open them from within your app using URL schemes but the built in iOS photos app is not one of them. 某些应用程序允许您使用URL方案从应用程序内部打开它们,但内置的iOS照片应用程序不是其中之一。

Only way to see the photo album is by creating a UIImagePickerController and setting its source type as UIImagePickerControllerSourceTypePhotoLibrary . 查看相册的唯一方法是创建UIImagePickerController并将其源类型设置为UIImagePickerControllerSourceTypePhotoLibrary This will open it in album view inside the app. 这将在应用程序内的相册视图中将其打开。 I am not sure whether that satisfies your requirement completely. 我不确定这是否完全满足您的要求。

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;

Alternatively you can also check asset library and the sample code 另外,您也可以检查资产库示例代码

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM