leftBarButtonItem和backBarButtonItem的不同点
在第一个根视图里设置如下
// 设置左侧按钮
UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:nil action:nil];
// self.navigationItem.leftBarButtonItem = leftItem;
UIBarButtonItem *leftItem2 = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemBookmarks target:self action:@selector(bookmark)];
self.navigationItem.leftBarButtonItems = @[leftItem, leftItem2];
// 3.设置返回按钮
// 设置的是下一个控制器左上角按钮的title
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIBarButtonItemStylePlain target:nil action:nil];
结果如下:
根视图 入栈视图
网友评论