美文网首页
iOS项目中要求导航栏的返回按钮只保留那个箭头,去掉后边的文字

iOS项目中要求导航栏的返回按钮只保留那个箭头,去掉后边的文字

作者: 第二沦陷区 | 来源:发表于2018-04-18 13:01 被阅读0次

ios 11以前使用

[[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(NSIntegerMin, NSIntegerMin) forBarMetrics:UIBarMetricsDefault];

会导致图片偏下,这中方式不可用

ios 11之后,考虑隐藏title,设置其透明度

[[UIBarButtonItem appearance] setTitleTextAttributes:@{ NSForegroundColorAttributeName: [UIColor clearColor] } forState:UIControlStateNormal];

相关文章

网友评论

      本文标题:iOS项目中要求导航栏的返回按钮只保留那个箭头,去掉后边的文字

      本文链接:https://www.haomeiwen.com/subject/wmevkftx.html