0
對於我正在處理的應用程序,我正在嘗試拍攝一系列圖像並將它們鏈接到UISlider。與滑塊交互會創建一個動畫效果,循環播放幀。我已經能夠從一系列圖像創建一個獨立的動畫,但是我不太確定如何添加UISlider並製作適當的鏈接以實現所需的效果。如何使用UISlider循環訪問UIImageView圖像序列以創建動畫效果
這裏是我迄今爲止...
- (void) viewDidLoad{
// ---動畫圖像陣列---- /*
NSArray *images = [NSArray arrayWithObjects:
[UIImage imageNamed:@"frame1.png"],
[UIImage imageNamed:@"frame2.png"],
[UIImage imageNamed:@"frame3.png"],
[UIImage imageNamed:@"frame4.png"],
[UIImage imageNamed:@"frame5.png"],
[UIImage imageNamed:@"frame6.png"],
[UIImage imageNamed:@"frame7.png"],
[UIImage imageNamed:@"frame8.png"],
[UIImage imageNamed:@"frame9.png"],
[UIImage imageNamed:@"frame10.png"],
nil];
CGRect frame = CGRectMake(0,44,703,704);
UIImageView *imageView = [[UIImageView alloc] initWithFrame:frame];
imageView.animationImages = images;
imageView.contentMode = UIViewContentModeScaleAspectFit;
imageView.animationDuration = 4;
imageView.animationRepeatCount = 0;
[imageView startAnimating];
[UIView setAnimationTransition:UIViewAnimationTransitionNone forView:imageView cache:YES];
[self.view addSubview:imageView];
[imageView release];
[super viewDidLoad];
任何線索?