UIImage * backImage = [[UIImage imageNamed:@"title_back_icon"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
[UINavigationBar.appearance setBackIndicatorImage:backImage];
[UINavigationBar.appearance setBackIndicatorTransitionMaskImage:backImage];
if(@available(iOS 11, *)) {
[[UIBarButtonItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor clearColor]} forState:UIControlStateNormal];
[[UIBarButtonItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor clearColor]} forState:UIControlStateHighlighted];
} else {
[[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(-60, -60) forBarMetrics:UIBarMetricsDefault];
}
[转自StackOverFlow](https://stackoverflow.com/questions/46193204/custom-back-indicator-image-and-ios-11)
网友评论