Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Boesesreh

macrumors newbie
Original poster
Aug 5, 2009
13
0
I'm back with another question. I want my toolbar buttons to look like the one in the attachment. Is there an easy way of doing this or do i have to go through the whole custom view process. I don't even know how to this with custom view so a little help woul'd be really great
 

Attachments

  • Button.png
    Button.png
    3.2 KB · Views: 1,085
I have not played with this too much yet. Have you tried to use a round button and setting that image to that property? All I have done is change the background of a button and it seems to overwrite the original rect.
 
Yeah i played around using the background image myself but i always endet up loosing the text i wanted to display. I looked at the catalog.app but i don't think this is going to help me because there are only buttons with only a image and i dont really want to create 100 images for that :D
 
I looked at the catalog.app but i don't think this is going to help me because there are only buttons with only a image and i dont really want to create 100 images for that :D
The first button example (createGrayButton) combines a background image and a text label ("Gray"). Look into that more closely and you won't need to create 100 images.
 
Oh now that you say it. Is it possible to do this the same way for UIBarButtonItems or is there another way of doing this?
 
Oh now that you say it. Is it possible to do this the same way for UIBarButtonItems or is there another way of doing this?
Ah, my apologies. I must've glossed over that you wanted UIBarButtonItems and not just regular UIButtons, even though it was right there in the thread title. How silly of me!

So, UIBarButtonItem can be created with a UIBarButtonSystemItem, a custom view, an image or a title. Based on the button sample you attached to your OP, they seem to be using both an image (the arrow) and text ("Postpone (3)"). I'm not sure if this is possible by combining UIBarItem (UIBarButtonItem's superclass) properties of image and title; I kinda doubt it. (Don't give up on that possibility without investigtion.) I would suspect that a custom view may be required, however.
 
It looks like a lot of work and I start thinking about forgetting the count in the braces and just make two images, one for enabled and another gray one for disabled. (Image = Image + text) I guess this would be the easiest way of doing this. Allthough it's sad that this feature isn't predefinded because the mail app includes it (yeaah the mail app again ^^) and I've seen it in at least one other app looking the exact same way

Thanks again for the help
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.