Invert the UIBarButtonItem "Play" to use as the back button?

Good, simple enough.

I encode a simple webview, and I provide several Safari-like controls for navigation.

The game seems like the obvious choice for the forward button, but I would like to have a back button, as can be seen from several Apple and third-party applications.

Is there a way to invert the icon so that it appears in the opposite direction, or all applications using this setting using images to replicate this function?

+5
source share
3 answers

Unicode is your friend here.

UIBarButtonItem ( ) "Custom", .

"" "":

◄ ►

, .

+13

, , ...

, Unicode, , ios. ios, "", .

UIImage *image = [UIImage imageNamed:@"backButton.png"];
UIButton *btnBack = [UIButton buttonWithType:UIButtonTypeCustom];
[btnBack setImage:image forState:UIControlStateNormal];
btnBack.frame = CGRectMake(0.0, 0.0, image.size.width, image.size.height);

UIBarButtonItem * btnItem = [[UIBarButtonItem alloc] initWithCustomView:btnBack];
[btnItem addTarget:self action:@selector(btnClicked:) forControlEvents:UIControlEventTouchUpInside];
// add it to your bar
self.navigationItem.leftBarButtonItem = btnItem;

( ... , )

// . http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/mobilehig/IconsImages/IconsImages.html

+1

You can use atPeek to extract the png play button from an application that uses it, and then use any image management program to turn it over.

0
source

All Articles