Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

有问题 #2

Closed
suzhiqiu opened this issue Sep 18, 2017 · 2 comments
Closed

有问题 #2

suzhiqiu opened this issue Sep 18, 2017 · 2 comments

Comments

@suzhiqiu
Copy link

再push一个viewcontronller。回来的时候。 靠左边的约束直接没有了。返回按钮直接靠到屏幕去了,没有间距。 如果不push,用起来是正常的。 有联系方式么?

@spicyShrimp
Copy link
Owner

写在viewWillAppear:中,保证在界面将要显示的时候确保其约束即可
类似demo中的
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[self configBarItem];
}

-(void)configBarItem{
if (self.navigationController.viewControllers.count > 0) {
self.navigationItem.rightBarButtonItem = [UIBarButtonItem itemWithTarget:self action:@selector(pushAction) image:[UIImage imageNamed:@"nav_add"]];
}
if (self.navigationController.viewControllers.count > 1) {
self.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithTarget:self action:@selector(popAction) image:[UIImage imageNamed:@"nav_back"]];
}
}

@spicyShrimp
Copy link
Owner

spicyShrimp commented Sep 18, 2017

我的QQ 78268731 如果需要添加请备注,谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants