Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

UINavigation Back Button not working #130

Open
gilthonweapps opened this issue Nov 19, 2013 · 2 comments
Open

UINavigation Back Button not working #130

gilthonweapps opened this issue Nov 19, 2013 · 2 comments
Labels

Comments

@gilthonweapps
Copy link

Hi,

If I change the "back" button of my navigation bar, it style uses the iOS6 layout.

Here is the code I use:

self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Back", nil)
style:UIBarButtonItemStyleBordered
target:nil
action:nil];

@gilthonweapps
Copy link
Author

It doesn't work only when the view is not pushed inside a navigationcontroller.

@hatunike
Copy link

hatunike commented Feb 4, 2014

My temp fix is bad (and really don't recommend unless you GOTTA have this working right). I stopped UI7 kit from handling my UINavigationBar, UINavigationController, and UINavigationItem. (remove those class names from UI7KitCore patch method).

And then in my App delegate appDidFinishLaunching method I'm just using [UINavigationBar appearance] methods to mimick the iOS7 look and feel. This is actually easier than you'd think because you can pretty much just use the same implementation that ui7Kit uses. For example, the back button :

    UIImage *backImage = [UIImage imageNamed:@"UI7NavigationBarBackButton"];
    backImage = [backImage imageByFilledWithColor:tintColor];
    [[UIBarButtonItem appearance] setBackButtonBackgroundImage:backImage forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
    backImage = [backImage imageByFilledWithColor:tintColor];
    [[UIBarButtonItem appearance] setBackButtonBackgroundImage:backImage forState:UIControlStateHighlighted barMetrics:UIBarMetricsDefault];

I've got my tint color defined above and I also import #import "UIImage.h"
#import "UI7Color.h".

This is definitely only recommended if you are really having back button issues.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants