我已经在UIImageView中加载了一组图像。如何使用CoreAnimation在UIImageView中对图像进行动画处理? PLZ给我suggesstionsiphone sdk:如何在UIImageView中使用CoreAnimation动画设置图像集?
回答
如果你只想动画在ImageView的图像集,下面的代码将有助于
UIImageView* animatedImageView = [[UIImageView alloc]init];
animatedImageView.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"1.gif"],
[UIImage imageNamed:@"2.gif"],
[UIImage imageNamed:@"3.gif"],
[UIImage imageNamed:@"4.gif"], nil];
animatedImageView.animationDuration = 1.0f;
animatedImageView.animationRepeatCount = 0;
[animatedImageView startAnimating];
[self.view addSubview: animatedImageView];
嗨,我想在一个线程中运行动画部分。如何在一个线程中做到这一点。怎么做? – iphony 2012-04-18 06:47:40
使用CoreAnimation(CABasicAnimation),它运行在它自己的线程中。 – TompaLompa 2012-04-19 05:23:34
它是与剩余时间的动画图像非常漂亮的代码,如果你设置的计时器报警在动画根据定时器的剩余秒我已经使用图像以便使花
{图像
// -----------------图片动画------------------- //
-(void)imageAnimationMethod
{
imageAnimation=[[UIImageView alloc]initWithFrame:CGRectMake(20, 150, 135, 135)];
[ self.view addSubview:imageAnimation];
imageAnimation.animationImages=[NSArray arrayWithObjects:
[UIImage imageNamed:@"101.png"],
[UIImage imageNamed:@"102.png"],
[UIImage imageNamed:@"103.png"],
[UIImage imageNamed:@"104.png"],
[UIImage imageNamed:@"105.png"],
[UIImage imageNamed:@"106.png"],
[UIImage imageNamed:@"107.png"],
[UIImage imageNamed:@"108.png"],
[UIImage imageNamed:@"109.png"],
[UIImage imageNamed:@"110.png"],
[UIImage imageNamed:@"111.png"],
[UIImage imageNamed:@"112.png"],
[UIImage imageNamed:@"113.png"],
[UIImage imageNamed:@"114.png"],
[UIImage imageNamed:@"115.png"],
[UIImage imageNamed:@"116.png"],
nil];
// -----剩余的第二剩余的计时器--------- //
int i=remaining*16/16;
imageAnimation.animationDuration=i;
imageAnimation.animationRepeatCount=0;
}
}
它为我工作,感谢jaspreet – ravinder521986 2012-08-30 07:31:28
- 1. 使用CoreAnimation动画草(在iPhone上)
- 2. 如何设置动画使用图像
- 3. 如何在UIImageView iOS中使用启动图像集?
- 4. iPhone SDK:将动画加载(齿轮)图像设置为UIBarButtonItem
- 5. 动画UIImageView iPhone
- 6. 使用UIImagePickerControllerReferenceURL在UIImageView上设置图像
- 7. 在uiimageview中设置视网膜图像
- 8. 如何在iPhone中为Tabbar项设置图像sdk
- 9. 如何为iPhone SDK中的速度计指针设置动画?
- 10. Swift - 动画UIImageView图像
- 11. UIImageView动画的动画帧图像
- 12. IPhone UIImageView图像
- 13. CoreAnimation动画帧
- 14. Iphone SDK - 动画子视图
- 15. iPhone SDK:无法拖动UIImageView
- 16. 在背景图像上动画UIImageView
- 17. 来自图像集的iphone动画
- 18. UIImageView的设置图像
- 19. 如何在iphone sdk中设置NSTimer?
- 20. 如何在UIImageView中设置图片
- 21. 图像与动画在iphone
- 22. Iphone SDK App UIImageView
- 23. 如何在iPhone SDK中裁剪图像?
- 24. 如何使用StoryBoard从另一个ViewController设置UIImageView的图像?
- 25. iPhone UIImageView动画效果
- 26. iPhone中的子视图的动画sdk
- 27. 是否有任何替代动画使用UIImageView图像数组?
- 28. 如何在iphone sdk中动态分配UIImageView?
- 29. 如何设置包含在NSMutableArray中的UIImageView的图像?
- 30. 如何使用iPhone UIImageView链接缩放动画?
你到底要如何制作动画呢? – TompaLompa 2012-04-18 06:17:47
我想重复使用线程动画。当我在图像视图上拖动时,另一组图像将被加载并开始对图像进行动画处理。我完成了所有的线程。但动画有时不顺畅。如何带来流畅的动画? – iphony 2012-04-18 07:19:50