On the simulator, my animation method runs smoothly. Unfortunately it seems to be very jerky running on an iPhone 4.
我不会百分之百地肯定做 an事的最佳和最快的方式——因此,对于我如何能够优化或彻底修改我的法典以加快这一 an升表示最赞赏!
<>说明:
它已经站在主线上,这样,派遣国——阿辛(派遣国——目标_主要——(频率))就会毫不相干或毫无帮助?
是否有办法预先缓冲这一估计?
是否有办法看看,哪一部分法典在做大部分放慢?
在延期方面,只有大约3或4个意见。 观点。
I ve与Os编辑。
- (void)extendWithAnimation:(BOOL)animated; {
isExtended = YES;
extensionView.hidden = NO;
topShadowView.hidden = NO;
topShadowView.frame = CGRectMake(0, defaultHeight, topShadowView.frame.size.width, topShadowView.frame.size.height);
topShadowView.layer.bounds = CGRectMake(0, 0, topShadowView.frame.size.width, 0);
extensionView.frame = CGRectMake(0, defaultHeight - 8, DEVICE_WIDTH, extensionHeight + 8);
extensionView.layer.bounds = CGRectMake(0, 0, DEVICE_WIDTH, 0);
for (UIView *view in extensionView.subviews) {
view.transform = CGAffineTransformMakeTranslation(0, -(extensionHeight+8));
}
dispatch_async(dispatch_get_main_queue(), ^{
if (animated) {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.3];
[UIView setAnimationDelegate:self];
}
extensionView.layer.bounds = CGRectMake(0, 0, DEVICE_WIDTH, extensionHeight + 8);
topShadowView.layer.bounds = CGRectMake(0, 0, topShadowView.frame.size.width, extensionHeight + 8);
for (UIView *view in extensionView.subviews) {
view.transform = CGAffineTransformIdentity;
}
if (animated) {
[UIView commitAnimations];
}
});
}
<>Solution:
Solved (thanks Aaron!).
Rendered shadows kill animation big time! Don t use any core graphics shadow properties if you re planning on animating - in my case just a few shadows reduced the frame rate three fold.