我调用系统图库,当我选择好照片的时候,希望上面的“取消”按钮变成”确定“按钮,该怎么做?!!
图片描述
求大神指教!!!!
现在的情况是:只要我选好照片然后选择
最终想要实现的功能就像     QQ发表说说那样样!!!
最后附上我的代码:
-(void)changeImageFormPhoto{
    pickerController =[[UIImagePickerController alloc]init];
    pickerController.delegate =self;
    pickerController.sourceType =UIImagePickerControllerSourceTypePhotoLibrary;
    pickerController.modalTransitionStyle =UIModalTransitionStyleCoverVertical;
    [self presentViewController:pickerController animated:YES completion:nil];
}
//完成选取
- (void)imagePickerController:(UIImagePickerController *)picker
        didFinishPickingImage:(UIImage *)image
                  editingInfo:(NSDictionary *)editingInfo
{
    NSData *data =UIImagePNGRepresentation(image);
    [ChangImage setImage:image];
    //image为选中图片
    [[picker parentViewController] dismissModalViewControllerAnimated:YES];
}
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
当然,不需要制作重复的轮子,你可以在下面的两个列表中找到github开源的。
代码库选择
*cocoaChina代码库->选择器(点击查看)
*code4app代码库->选择器(点击查看)
备注
如果你希望自己写一下,建议看下别人的开源代码。这样会解决很多问题