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];
  • 相关阅读:
    [UE4]Image
    [UE4]CheckBox
    [UE4]Button
    [UE4]Border
    [UE4]RichTextBlock
    [UE4]Text Box
    [UE4]字体材质
    [UE4]Retainer Box
    [UE4]Invalidation Box
    [UE4]Dynamic Entry Box
  • 原文地址:https://www.cnblogs.com/mafeng/p/5885521.html
Copyright © 2011-2022 走看看