简体   繁体   中英

iOS: Back toolbar bar button item

I need the back arrow toolbar bar button item.

In identifier of bar button item, there is play, refresh, reload, and stop.

I need the image of play, but flipped 180 degrees.

Is there a way to flip the image with code? If not, where can I find this image?

here's a simple work around: declare your button with "initWithTitle" and set the title to @"◀" (it's just a unicode symbol). Use @"▶" for the forward button to make it consistent. I tried it and it worked for me.

Do a Google search for play button vector graphic. Make the one you want the image of the button. Should still be able to tell the button to maintain it's bar button style.

One straightforward option is to draw a white triangle of the appropriate size and orientation in an image editor, stick it in an image view, and then use that image view for a bar button item's custom view.

I wouldn't try to use the UIBarButtonSystemItemPlay image. I don't know if manipulating system images is expressly proscribed, but Apple generally doesn't smile on misuse of system items. When you get right down to it, it's just a white triangle, so it'd be hard to tell the difference between drawing your own or reversing theirs. That just seems like all the more reason to draw your own.

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