在界面构建器/故事板中设置UIButton图像 [英] Set UIButton image in interface builder / storyboard

查看:88
本文介绍了在界面构建器/故事板中设置UIButton图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个View Controller,我在故事板中添加了一个圆形的矩形按钮。
应用程序运行良好,我还使用故事板将按钮连接到segue。
我正在尝试为这个按钮设置一个自定义图像,以便在& off状态下。
如何访问此按钮并设置其属性? (在这种情况下,开启和关闭图像)

I have a View Controller which I add a round rect button to in storyboard. The application is working well and I also connected the button to a segue using the storyboard. 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)

推荐答案

以下是截图:

设置你的按钮类型为自定义,并更改所有状态的图像(选择状态,然后选择图像,重复每个状态)。

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).

这篇关于在界面构建器/故事板中设置UIButton图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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