大佬教程收集整理的这篇文章主要介绍了旋转动画xcode iphone,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
谢谢你的帮助.
ViewController.h
#import <UIKit/UIKit.h> @interface ViewController : UIViewController { IBOutlet UIImageView *theImageView; IBOutlet UIButton *theButton; NSTimer *theTimer; float angle; BOOL runStop; } @property (atomic,retain) IBOutlet UIImageView *theImageView; @property (atomic,retain) IBOutlet UIButton *theButton; -(IBACtion)runRoulette:(id)sender; @end
ViewController.m
#import "ViewController.h" @interface ViewController () @end @implementation ViewController @synthesize theButton,theImageView; - (void)viewDidLoad { angle = 0; runStop = falSE; [super viewDidLoad]; // Do any additional setup after loading the view,typically from a nib. } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } -(void)rotateRoulette { theImageView.center = CGPointMake(self.theImageView.center.x,self.theImageView.center.y); theImageView.transform=CGAffineTransformMakeRotation (anglE); angle+=0.001; } -(IBACtion)runRoulette:(id)sender { if(!runStop) { theTimer = [NSTimer scheduledTimerWithTimeInterval:1.0/600.0 target:self SELEctor:@SELEctor(rotateRoulettE) userInfo:nil repeats:YES]; } else { [theTimer invalidate]; theTimer = nil; } runStop = !runStop; } @end
theImageView.center = CGPointMake(160.0,364.0); [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:5]; //theImageView.center=CGPointMake(self.theImageView.center.x,self.theImageView.center.y); theImageView.transform = CGAffineTransformMakeRotation(M_PI/2.65); [UIView commitAnimations];
以上是大佬教程为你收集整理的旋转动画xcode iphone全部内容,希望文章能够帮你解决旋转动画xcode iphone所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。