UI7Kit icon indicating copy to clipboard operation
UI7Kit copied to clipboard

UINavigation Back Button not working

Open gilthonweapps opened this issue 12 years ago • 2 comments

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 avatar Nov 19 '13 22:11 gilthonweapps

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

gilthonweapps avatar Nov 19 '13 22:11 gilthonweapps

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.

hatunike avatar Feb 04 '14 19:02 hatunike