简体   繁体   中英

Standard way to have a UIBarButtonItem point to the right?

When a new view controller is pushed onto the navigation stack, there is standard support for a back button with the title of the previous view controller. This button "points" to the left rather than having a rounded rectanglar shape.

Is there a standard way to create a UIBarButtonItem that "points" to the right? This button would be used as the rightBarButtonItem.

Using the Three20 library you can do it easily without creating an image yourself (and it will size up correctly depending on your text):

This screenshot comes from the example application that comes with Three20.

You could use one of the PNG files floating around with iPhone UI widgets ( example ). Take the left-pointing button and flip it horizontally in Photoshop or another image editing tool to make it point right-wards.

Then insert a UIButton into the rightBarButtonItem view, using the horizontally-flipped widget as its image property.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM