Custom UIBarButtonItem with Quartz

How can I draw a quartz button that has the same style as UIBarButtonItem. The button should show different colors. I downloaded the Three20 project, but this project is really complicated, you need a lot of time to skip the entire infrastructure. I just want to draw a custom UIBarButtonItem.

Thanks for the help.

+4
source share
2 answers

If you use the Three20 library, I think the TTButton toolbarButton style is what you want. TTButton is a subclass of UIButton, but it allows you to apply styles the same way you use css when creating a web page.

To create a button like UIBarButtonItem, just call

[TTButton buttonWithStyle:@"toolbarButton:" title:@"Title"] 

You may need to save it because the button is the subject of an automatic release.

0
source

Try UISegmentedControl with only one segment and short-term selection. It supports tintColor and can be close enough for your purposes.

+1
source

Source: https://habr.com/ru/post/1301189/


All Articles