【问题标题】:Navigation Bar Top Item, not showing back bar button, the left is showing when created but it doesnt show the arrow <导航栏顶部项目,不显示返回栏按钮,左侧显示创建时但不显示箭头<
【发布时间】:2018-05-22 14:54:48
【问题描述】:

代码在 Objective-C 中,我希望在不添加图像作为 src 的情况下显示箭头。 我已经完成了更改控制器时自动显示的项目。

在这里我创建了左栏按钮:

 navItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStylePlain target:self action:@selector(returnToPreviousScreen)];

这显示得很好并且可以按预期工作,但它没有在文本左侧显示

【问题讨论】:

    标签: ios uibarbuttonitem uinavigationitem


    【解决方案1】:

    尝试在 navigationItem 上设置 backBarButtonItem 属性,但不要在推送的视图控制器中执行此操作,而是在前一个视图控制器中执行此操作。您可以将目标和选择器设置为 nil,在 backBarButtonItem 上设置时不会产生任何影响。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-12-19
      • 2013-01-20
      • 2019-01-18
      • 2019-01-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多