Swift
I want to create a custom icon downloaded from the internet for a UIBarButton . Do I have to do this programmatically or can I some how find a setting via storyboard? If I choose " custom " it doesn't lead to further choosing of custom icons or anything so I'm not really sure what to do here.
I see there is a " Bar Item: Image " section. Is this what I will use?
Thanks!
Yes, the image (at the end of that link you posted) is where you would select your image. You need to put it into your project first though.
So steps to do:
There is another way you can do this; programmatically, but it's slightly trickier. You still do step 1 but then instead of step 2, you can create an outlet to the Bar Button item and set its image like this:
barButtonItem.image = UIImage(named: "imageName.PNG")
If you need any clarification of what I've said, feel free to ask.
Loic
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.