backButton更换图片 backbutton图片尺寸的话 42*42
写法一:
[self.navigationBar setBackIndicatorImage:[UIImage imageNamed:@"Nav_Back"]];
[self.navigationBar setBackIndicatorTransitionMaskImage:[UIImage imageNamed:@"Nav_Back"]];
写法二:
UIImage *backButtonImage = [[UIImage imageNamed:@"Nav_Back"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:backButtonImage forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
去除backButton文字
[[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(NSIntegerMin, NSIntegerMin)
forBarMetrics:UIBarMetricsDefault];
网友评论