
Lay out subvIEws at commit time so that they are animated along with
their parent.
这是我感兴趣的代码示例.我希望为detailVIEw的-layoutSubvIEws设置动画;但是,它似乎没有布局detailVIEw的子视图,所以我不确定它实际上有什么影响.
voID (^animation) () = ^ { [self.detailVIEw setNeedsLayout]; [self.detailVIEw layoutIfNeeded]; }; [UIVIEw animateWithDuration:0.5 delay:0.0 options:UIVIEwAnimationoptionLayoutSubvIEws animations:^{ animation(); } completion:nil];解决方法 由于您希望第二个动画从第一个动画的当前状态(无论是否完成)发生,我建议在设置第二个动画时使用UIVIEwAnimationoptionLayoutSubvIEws选项. [UIVIEw animateWithDuration:0.2 delay:0.0 options:UIVIEwAnimationoptionLayoutSubvIEws animations:^{ CGAffinetransform settingstransform = CGAffinetransformMakeTranslation(self.animatedVIEw.frame.size.wIDth,0); self.animatedVIEw.transform = settingstransform; } completion:nil]; 总结 以上是内存溢出为你收集整理的ios – UIViewAnimationOptionLayoutSubviews的工作原理示例?全部内容,希望文章能够帮你解决ios – UIViewAnimationOptionLayoutSubviews的工作原理示例?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)