[英]Set UIButton image in interface builder / storyboard
I have a View Controller which I add a round rect button to in storyboard. 我有一个View Controller,我在故事板中添加了一个圆形的矩形按钮。 The application is working well and I also connected the button to a segue using the storyboard.
该应用程序运行良好,我还使用故事板将按钮连接到segue。 I am trying to set a custom image for this button for it on&off states.
我正在尝试为此按钮设置自定义图像,以便打开和关闭状态。 How do i access this button and set it's properties?
如何访问此按钮并设置其属性? (in this case the on & off images)
(在这种情况下,开关图像)
Here is a screenshot : 这是一个截图:
Set your button type to Custom, and change the image for all the states (choose a state, then choose the image, repeat for each state). 将按钮类型设置为自定义,并更改所有状态的图像(选择状态,然后选择图像,对每个状态重复)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.