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

前端 未结 2 1760
被撕碎了的回忆
被撕碎了的回忆 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: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];
    

提交回复
热议问题