How do you change color/image on the default backBarButtonItem?

前端 未结 2 1759
被撕碎了的回忆
被撕碎了的回忆 2021-01-16 06:15

I need to change color on the default \"self.navigationItem.backBarButtonItem\". To accomplish this I´ve created an custom Button class and implemented it like this:

相关标签:
2条回答
  • 2021-01-16 06:44

    Ok found the solution (not so good but it works) do this: 1: Implement the button from this tutorial: www.switchonthecode.com

    This will override the default behavior of navigationbar.

    2: Implement this in every view that needs the custom button: osmorphis.blogspot.com

    BR

    0 讨论(0)
  • 2021-01-16 06:45

    If you want the button to be blue (like a Done button) and have the title "Save" you can use one of the built in bar button item types:

    UIBarButtonItem *item = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave target:self action:@selector(myAction:)] autorelease];
    
    0 讨论(0)
提交回复
热议问题