导航返回按钮替换和取出返回按钮文字 - iOS

2017-06-21  本文已影响24人  HAKA
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];  
上一篇 下一篇

猜你喜欢

热点阅读