- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
UIBarButtonItem *rightBtnItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave target:self action:@selector(finish)];
self.navigationItem.rightBarButtonItem = rightBtnItem;
}
-(void) finish
{
// [self.delegate getNString:@"abc"];
[self.navigationController popViewControllerAnimated:YES];
}自制按钮返回界面
最新推荐文章于 2025-07-11 12:53:52 发布
本文介绍了一个简单的iOS应用中如何设置导航栏右侧按钮并实现返回功能。通过UIBarButtonItem的初始化及navigationController的popViewControllerAnimated方法实现了界面间的跳转。
802

被折叠的 条评论
为什么被折叠?



