OGeek|极客世界-中国程序员成长平台

标题: iphone - UIImagePickerController : How do I add button and select photo [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 11:11
标题: iphone - UIImagePickerController : How do I add button and select photo

enter image description here

如何添加按钮并选择照片。请帮忙告诉我如何解决



Best Answer-推荐答案


您需要创建一个 CustomOverlayView。然后像这样配置你的选择器:

    overlay = [[CustomOverlayView alloc]initWithFrame:self.view.bounds];
    overlay.delegate = self;
    picker = [[UIImagePickerController alloc]init];
    picker.delegate = self;
    picker.navigationBarHidden = YES;
    picker.toolbarHidden = YES;
    picker.wantsFullScreenLayout = YES;
    picker.allowsEditing = YES;
    if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]){

        picker.sourceType = UIImagePickerControllerSourceTypeCamera;
    }
    else{
        picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
    }
    picker.showsCameraControls = NO;
    picker.cameraOverlayView = overlay;

关于iphone - UIImagePickerController : How do I add button and select photo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16717992/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4