非常感谢
- (UIBezIErPath *)createCircleForRect:(CGRect)bRect{ UIBezIErPath *circle = [UIBezIErPath bezIErPath]; CGfloat rectWIDth = bRect.size.wIDth; CGfloat rectHeight = bRect.size.height; minSize = MIN(rectWIDth,rectHeight); //center = CGPointMake(minSize/2.0f,minSize/2.0f); CGfloat radius = minSize/2.0f - 5.0f; startPointOffset = center.x - radius; if(startPointOffset == 5.0f) testVal = 0; else testVal += startPointOffset; NSLog(@"startPointOffset =>> %f",startPointOffset); NSLog(@"radius =>> %f",radius); NSLog(@"after center =>> %f,%f",center.x,center.y); [circle addArcWithCenter:center radius:radius startAngle:degrees_TO_radians(0) endAngle:degrees_TO_radians(180) clockwise:NO]; [circle movetoPoint:CGPointMake(startPointOffset,center.y)]; [circle addCurvetoPoint:CGPointMake(center.x + radius,center.y) controlPoint1:CGPointMake(center.x - radius,rectHeight + 10.0f) controlPoint2:CGPointMake(center.x + radius,rectHeight + 10.0f)]; [circle closePath]; return circle;}-(voID)startAnimation{ CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"path"]; animation.duration = 1.0; animation.repeatCount = HUGE_VALF; animation.autoreverses = YES; animation.timingFunction = [camediatimingFunction functionWithname:kcamediatimingFunctionEaseInEaSEOut]; animation.fromValue = (ID)roundBPath; CGRect smallerRect = self.frame; smallerRect.size.height += 50; smallerRect.size.wIDth -= 80; UIBezIErPath *newRound = [self createCircleForRect:smallerRect]; animation.tovalue = (ID)(newRound.CGPath); [shapeLayer addAnimation:animation forKey:@"animatePath"];}解决方法 iOS 6 Mail中的pull-to-refresh控件是任何应用程序都可以使用的标准UIKit控件:请参阅UItableVIEwController上的
refreshControl
属性和 UIRefreshControl
类. (另请注意,您可以通过为表视图控制器选择“Refreshing – > Enabled”在XCode 4.5上的IB中设置一个.) 不过,如果您要部署到iOS 5或更早版本,ODRefreshControl是一个不错的选择.
总结以上是内存溢出为你收集整理的在iOS6中拉动像邮件一样刷新动画全部内容,希望文章能够帮你解决在iOS6中拉动像邮件一样刷新动画所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)