标签列表
获取UIButton的背景图片
iphone
objective-c
uiview
uiimageview
uibutton
12
12
我需要您的建议:我想知道如何在UIImageView中设置UIButton的背景图像。
例如,如果我点击按钮,则应在UIImageView上设置按钮的背景图像。
这是否可能? 如果是,那么该怎么做?
-
Shrey
2
不是“点击”,而是“触摸” :)
- Richard J. Ross III
1
为什么这个被踩了?我的点赞把它变成了0!这个问题非常有用 - 苹果只是针对这个类打破了他们的命名约定,使得很难发现这个属性的存在 :(
- Adam
1
个回答
42
42
UIImage *image = self
.myButton
.currentBackgroundImage
;
UIButton的Apple文档
-
GendoIkari
1
我在获取button.currentBackgroundImage时得到了nil的返回值。我使用了UIImage *image = buttonObject.currentBackgroundImage; 请指出我的错误之处。
- Mehul Solanki
回答链接
网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接
相关问题
6
iPhone - UIButton - 禁用状态下的背景图片
15
UIButton的背景图片内容模式未被尊重。
4
UIButton背景图片stretchableImageWithLeftCapWidth:topCapHeight问题
16
为UIButton设置背景图片
5
使用正方形背景图片的圆角UIButton
6
UIButton上的背景图片缩放不正确
5
UIButton背景图片上的自定义绘图
4
UIButton背景图片未改变
9
UIButton背景图片动画化
34
为UIButton拉伸背景图片