Reputation:
I've created a UIBarButtonItem and then set self.navigationItem.rightBarButtonItem to the item.
However, I want to get the look and feel of the standard UIBarButtonItem.
Does anyone know how to reduce the width of the UIBarButtonItem without using a custom view ? (alternately, does anyone know how to create a UIView or UIButton that looks like a UIBarButtonItem)
Upvotes: 2
Views: 1612
Reputation: 31
Looks like Apple really don't want it (Human Interface Guidelines). However there is a somewhat static solution if you use your own view for it:
Just use images instead... use grab to copy the images from IB at the widths you want. Then they'll look exactly like the UIBarButtons
Apple shows you how to map two different images (and in this example functions as well) to the same button depending on the state... check out the "Add Music" sample code: http://developer.apple.com/iphone/library/samplecode/AddMusic/index.html
This is from TechGuru @ http://discussions.apple.com/thread.jspa?messageID=9822548
Upvotes: 2