UIImagePickerController *imagePickerController= [[UIImagePickerController alloc] init];
[imagePickerController setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
// image picker needs a delegate so we can respond to its messages
[imagePickerController setDelegate:self];
self.shouldCallViewWillAppear = NO;
if(IS_IOS8)
{
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
// Place image picker on the screen
[self presentViewController:imagePickerController animated:YES completion:nil];
}];
}
else
{
[self presentViewController:imagePickerController animated:YES completion:nil];
}
ios8 下iPad调用相册的方法!
iOS照片库选择器使用
最新推荐文章于 2022-12-18 22:08:58 发布
本文介绍如何在iOS应用中使用UIImagePickerController从照片库选择图片。通过设置代理和来源类型为相册,可以在应用中实现调用系统相册的功能。文中还提供了适配iOS 8及以后版本的方法。
1074

被折叠的 条评论
为什么被折叠?



