我想知道是否有动画UIImage.
我知道 UIImageViews 可以制作动画,但有什么方法可以直接在 UIImage 中制作.
I know that UIImageViews are possible to animate but is there any way to do it directly in a UIImage.
也许使用 Open GL ES 或其他什么?
Maybe with Open GL ES or something?
或者还有其他方法可以为 MPMediaItemArtwork 设置动画吗?
Or are there any other ways you can animate an MPMediaItemArtwork?
提前致谢!
创建一个UIImageView并将animationImages的属性设置为UIImage的数组代码>s
Create a UIImageView and set the property of animationImages to an array of UIImages
这是一个例子:
NSArray *animationFrames = [NSArray arrayWithObjects:
[UIImage imageWithName:@"image1.png"],
[UIImage imageWithName:@"image2.png"],
nil];
UIImageView *animatedImageView = [[UIImageView alloc] init];
animatedImageView.animationImages = animationsFrame;
[animatedImageView startAnimating];
如果您的目标是 iOS 5,您可以直接在 UIImage 中执行此操作,而无需使用 UIImageView
If you're targeting iOS 5 you can do this directly in UIImage without the UIImageView using
+(UIImage *)animatedImageWithImages:(NSArray *)images duration:(NSTimeInterval)duration
例如,
[UIImage animatedImagesWithImages:animationFrames duration:10];
这篇关于是否可以为 UIImage 设置动画?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
如何通过点击动画 UIImageview 以显示全屏?How to animate a UIImageview to display fullscreen by tapping on it?(如何通过点击动画 UIImageview 以显示全屏?)
停止 segue 并显示警报To stop segue and show alert(停止 segue 并显示警报)
iOS 5 故事板,以编程方式确定路径iOS 5 storyboard, programmatically determine path(iOS 5 故事板,以编程方式确定路径)
UIProgressView 和自定义跟踪和进度图像(iOS 5 属性UIProgressView and Custom Track and Progress Images (iOS 5 properties)(UIProgressView 和自定义跟踪和进度图像(iOS 5 属性))
语义问题:属性的合成 getter 遵循 Cocoa 命名约定以Semantic Issue: Property#39;s synthesized getter follows Cocoa naming convention for returning #39;owned#39; objects(语义问题:属性的合成 gette
试图在视图控制器之间传递数据Trying to pass data between viewControllers(试图在视图控制器之间传递数据)