我有两个屏幕。我想在第二个屏幕的导航栏更改后单击第一个屏幕的按钮。 我使用 Storyboard
第一屏代码
-(IBAction) ChangeSecondPageTitle: (id) sender {
SecondViewController *second=[[self storyboard] instantiateViewControllerWithIdentifier:@"second"];
second.modalTransitionStyle=UIModalTransitionStyleFlipHorizontal;
second.detailTitle.topItem.title=@"example";
[self presentModalViewController:second animated:YES];
}
第二个屏幕.h
@property (weak, nonatomic) IBOutlet UINavigationBar *detailTitle;
最佳答案
我猜你正在尝试为你的第二个屏幕导航栏设置标题。
使用导航 Controller 呈现您的第二个屏幕。
在 SecondDetailViewController 实例中,维护一个 NSString 属性。
@property (strong, nonatomic) NSString *navBarTitle;
在viewDidLoad中,设置title即可。
[self setTitle:navBarTitle];
关于iphone - 更改 UInavigationbar 标题后页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17148085/