iOSAnimation动画让图片不停的旋转360度-创新互联

第一种 让图片不停的旋转360度

秀洲网站建设公司创新互联,秀洲网站设计制作,有大型网站制作公司丰富经验。已为秀洲1000多家提供企业网站建设服务。企业网站搭建\外贸网站制作要多少钱,请找那个售后服务好的秀洲做网站的公司定做!

{

  double angle;

  UIImageView *p_w_picpathView;

}

 p_w_picpathView = [[UIImageView alloc] initWithFrame:CGRectMake(100, 100, 30, 5)];

  p_w_picpathView.p_w_picpath = [UIImage p_w_picpathNamed:@"1111.jpg"];

  [self.view addSubview:p_w_picpathView];

- (void)loopBasicAnimation

{

  //动画

  CABasicAnimation* rotationAnimation;

  rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];

  rotationAnimation.toValue = [NSNumber numberWithFloat: M_PI * 2.0 ];

  rotationAnimation.duration = 0.8;

  rotationAnimation.cumulative = YES;

  rotationAnimation.repeatCount = ULLONG_MAX;

  [p_w_picpathView.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];

}

第二种

- (void)stopLoppAnimation1{

  CGAffineTransform endAngle = CGAffineTransformMakeRotation(angle * (M_PI / 180.0f));

//时间

  [UIView animateWithDuration:0.01 delay:0 options:UIViewAnimationOptionCurveLinear animations:^{

    p_w_picpathView.transform = endAngle;

  } completion:^(BOOL finished) {

    angle = angle+10; //旋转速度的快慢

    [self stopLoppAnimation1];

  }];

}

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


网页名称:iOSAnimation动画让图片不停的旋转360度-创新互联
链接URL:http://lszwz.com/article/dseoig.html

其他资讯

售后响应及时

7×24小时客服热线

数据备份

更安全、更高效、更稳定

价格公道精准

项目经理精准报价不弄虚作假

合作无风险

重合同讲信誉,无效全额退款