美文网首页
iOS开发问题集合-持续更新

iOS开发问题集合-持续更新

作者: 刘明洋 | 来源:发表于2018-10-15 15:37 被阅读0次

    1、打包上传APP到iTunes connect时候出错。

    **Invalid Bundle**** - Your app supports Multitasking on iPad, so you must include the UILaunchStoryboardName key in your bundle, 'com.ZhiHuiShiAnBeiJing.PersonalFoodSafety’. Learn more (https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW40).

    C9773683-B481-4732-AD5B-3F996971C666.png

    2 iOS UIScrollView截图,长图截取办法

    - (UIImage*)getCapture:(UIScrollView *)scrollView
    {
        CGPoint savedContentOffset = scrollView.contentOffset;
        CGRect savedFrame = scrollView.frame;
        
        scrollView.frame = CGRectMake(0, scrollView.frame.origin.y, scrollView.contentSize.width, scrollView.contentSize.height);
        UIGraphicsBeginImageContextWithOptions(scrollView.contentSize, YES, 0.0); //currentView 当前的view  创建一个基于位图的图形上下文并指定大小为
        [scrollView.layer renderInContext:UIGraphicsGetCurrentContext()];//renderInContext呈现接受者及其子范围到指定的上下文
        UIImage *image = UIGraphicsGetImageFromCurrentImageContext();//返回一个基于当前图形上下文的图片
        
        scrollView.contentOffset = savedContentOffset;
        scrollView.frame = savedFrame;
        
        UIGraphicsEndImageContext();
        
        if (image) {
            UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), NULL);
        }
        return image;
    }
    //回调方法
    - (void)image: (UIImage *) image didFinishSavingWithError: (NSError *) error contextInfo: (void *) contextInfo
    {
        NSString *msg = nil ;
        if(error != NULL){
            msg = @"保存图片失败" ;
            
            [MBProgressHUD showSAToast:Type_Msg msg:msg];
        }
        else{
            msg = @"保存图片成功" ;
        }
    }
    

    相关文章

      网友评论

          本文标题:iOS开发问题集合-持续更新

          本文链接:https://www.haomeiwen.com/subject/acbfzftx.html