问题描述
我需要制作视图快照,以实现此目的,我想使用open func snapshotView(afterScreenUpdates afterUpdates: Bool) -> UIView?
UIView函数。该函数似乎是同步的,因为它不是在闭包中而是直接返回视图。另一方面,这是此功能的正式定义,可以在UIKit中找到
/*
* When requesting a snapshot,'afterUpdates' defines whether the snapshot is representative of what's currently on screen or if you wish to include any recent changes before taking the snapshot.
If called during layout from a committing transaction,snapshots occurring after the screen updates will include all changes made,regardless of when the snapshot is taken and the changes are made. For example:
- (void)layoutSubviews {
UIView *snapshot = [self snapshotViewAfterScreenUpdates:YES];
self.alpha = 0.0;
}
The snapshot will appear to be empty since the change in alpha will be captured by the snapshot. If you need to animate the view during layout,animate the snapshot instead.
然后怎么可能在快照拍摄后(是同步的)捕获快照所做的更改?我试图在网络上找到一些相关信息,但是没有运气。也许有人可以向我解释一下?谢谢
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)