【问题标题】:Change navigation item back button title更改导航项后退按钮标题
【发布时间】:2015-12-28 11:35:53
【问题描述】:

如何在不同的东西上更改< Wish list 按钮?

【问题讨论】:

标签: ios swift uinavigationbar


【解决方案1】:

如果有错误可以使用下面的代码告诉我

-(void)viewWillAppear:(BOOL)动画{ [super viewWillAppear:YES];

UIBarButtonItem *flipButton = [[UIBarButtonItem alloc]
                               initWithTitle:@"Pending"
                               style:UIBarButtonItemStyleBordered
                               target:self
                               action:@selector(flipView)];

self.navigationItem.leftBarButtonItem = flipButton;

} -(无效)翻转视图 { }

【讨论】:

  • 这不可能用故事板做?
  • 不,它可以在故事板中使用,我很早就在我的应用程序中尝试过
【解决方案2】:

试试这个,

let newBackButton = UIBarButtonItem(title: "SomeOtherTitle", style: UIBarButtonItemStyle.Bordered, target: self, action: "back:")
self.navigationItem.leftBarButtonItem = newBackButton;

func back(sender: UIBarButtonItem) {
    self.popViewControllerAnimated(true, completion: nil)
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-04-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多