首页 > 技术文章 > 获取View的快照

mgbert 2014-08-18 14:35 原文

//获取快照

- (UIView*)customSnapshotInView:(UIView*)inview

{

    UIView *snapshot = [inview snapshotViewAfterScreenUpdates:YES];

    snapshot.layer.shadowColor = [UIColor blackColor].CGColor;

    snapshot.layer.shadowOffset = CGSizeMake(0, 0);

    snapshot.layer.shadowRadius = 4;

    snapshot.layer.cornerRadius = 0;

    snapshot.layer.shadowOpacity = 0.9;

    return snapshot;

}

 

推荐阅读