YQNavigationController *nav = [[YQNavigationController alloc] initWithSize:CGSizeMake(250, 300) rootViewController:nil];
RootViewController *root = [[RootViewController alloc] init];
nav.rootViewController = root;
root.title = @"root";
[nav show:YES animated:YES];
__weak typeof(self) my = self;
[self.navigationBar setLeftBlock:^{
[my.yqNavigationController popYQViewControllerAnimated:YES];
}];
self.navigationBar.rightTitle = @"other";
[self.navigationBar setRightBlock:^{
OtherViewController *other = [[OtherViewController alloc] init];
[my.yqNavigationController pushYQViewController:other animated:YES];
}];
您要推出的新视图只需要继承YQViewController即可。
如果未设置导航栏左侧标题,导航栏将自动显示上一级视图控制器标题;默认显示“取消”。