zoukankan      html  css  js  c++  java
  • iOS10-- snapshotViewAfterScreenUpdates 失效

    如果snapshotViewAfterScreenUpdates失效, 用这个方法替代, 不过要自己创建ImageView 替代方式:

    - (UIImage *)imageFromView:(UIView *)snapView {
        UIGraphicsBeginImageContext(snapView.frame.size);
        CGContextRef context = UIGraphicsGetCurrentContext();
        [snapView.layer renderInContext:context];
        UIImage *targetImage = UIGraphicsGetImageFromCurrentImageContext();
        UIGraphicsEndImageContext();
        return targetImage;
    }
       UIImage *image = [self imageFromView:fromVC.fromVCImageView];
        UIImageView *snapView = [[UIImageView alloc] initWithImage:image];
        snapView.frame = fromVC.fromVCImageView.frame;
        [containerView addSubview:snapView];
  • 相关阅读:
    Java-循环语句和条件语句
    Java-变量函数 上
    python
    python
    python
    Xpath
    python + selenium
    python + selenium
    python + selenium
    Web
  • 原文地址:https://www.cnblogs.com/mafeng/p/5885521.html
Copyright © 2011-2022 走看看