动画的UIButton背景图片 [英] Animating UIButton background image

查看:143
本文介绍了动画的UIButton背景图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法动画与一组图片?

Is there a way to animate a UIButton background image view with a set of images?

我已经成功与ImageView的物业这样做,但找不到同等背景属性。

I've managed to do so with the imageView property, but couldn't find an equivalent background property.

10倍

推荐答案

要更改按钮图像底色或文本对于这个问题 - 你需要改变它的特定UIControlState ...即突出显示,选择,残疾人

To change a buttons backround image, or text for that matter - you need to change it for the particular UIControlState... i.e Highlighted, Selected, Disabled

使用

- (空)了setBackgroundImage:(*的UIImage)图像forState:(UIControlState)状态

我不知道,如果你能为它们制作动画,我从来没有尝试过。如果你不能为它们制作动画,那么你可以把一个UIImageView后面的透明按钮,并在代替动画影像 - 只是一个想法

I'm not sure if you can animate them, I've never tried. If you can't animate them, then you could put a UIImageView behind a transparent button and animate the images in that instead - just a thought.

这篇关于动画的UIButton背景图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆