国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統(tǒng) > iOS > 正文

IOS獲取系統(tǒng)相冊中照片的示例代碼

2020-07-26 03:15:08
字體:
來源:轉載
供稿:網(wǎng)友

先來看看效果圖

下面話不多少,我們直接上代碼:

#import "ViewController.h"@interface ViewController ()<UINavigationControllerDelegate,UIImagePickerControllerDelegate>@property (weak, nonatomic) IBOutlet UIImageView *IconView;@end@implementation ViewController- (IBAction)chooseImage {  //彈出系統(tǒng)相冊  UIImagePickerController *pickVC = [[UIImagePickerController alloc] init];  //設置照片來源  pickVC.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;  pickVC.delegate = self;  [self presentViewController:pickVC animated:YES completion:nil];}#pragma mark - UIImagePickerControllerDelegate-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *,id> *)info{  UIImage *photo = info[UIImagePickerControllerOriginalImage];  UIImageView *imageV = [[UIImageView alloc] init];  imageV.frame = self.IconView.frame;  imageV.image = photo;  imageV.userInteractionEnabled = YES;  [self.view addSubview:imageV];  [self dismissViewControllerAnimated:YES completion:nil];}@end

總結

以上就是IOS如何獲取系統(tǒng)相冊照片的示例代碼,有需要的朋友們可以直接用,對大家的開發(fā)還是很有幫助的,如果大家有疑問可以留言交流。

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 平谷区| 阿克苏市| 喜德县| 高清| 康平县| 肃宁县| 镇赉县| 延边| 洞口县| 赤城县| 太白县| 兴国县| 吴桥县| 镇江市| 潮州市| 嘉峪关市| 吉安县| 绥棱县| 宝应县| 徐州市| 安溪县| 福州市| 德化县| 德化县| 佛教| 榕江县| 武功县| 大田县| 吉隆县| 金山区| 怀宁县| 永城市| 开化县| 兴城市| 浑源县| 吉安市| 咸丰县| 景洪市| 亚东县| 邵阳县| 休宁县|