您好,我正在尝试添加一个导航栏项目到导航栏中的xib。但它在iOS7上运行得很好,但在iOS8.1中,它缩小到了border.How的边角,这是我试图放在正确位置的时候。谁能告诉我这是iOS8.1中的一个bug,或者有人能帮我解决这个问题。

发布于 2015-02-10 01:18:04
我可以建议一个解决方案,因为它有缺点:(用户的推送区域变得更小)
- (void)navigationBar
{
[ARNStylessetNavigationBarTransparent
:self.navigationController.navigationBar];
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[backBtn setAttributedTitle:whatEveryoulike];
[backBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[backBtn addTarget:self action:@selector(popBack) forControlEvents:UIControlEventTouchUpInside];
backBtn.frame = CGRectMake(0, 0, 63, 33);
UIView *backButtonView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 63, 33)];
backButtonView.bounds = CGRectOffset(backButtonView.bounds, 10, 10);
[backButtonView addSubview:backBtn];
UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithCustomView:backButtonView];
self.navigationItem.leftBarButtonItem = backButton;
}您将需要以编程方式添加它。我觉得最好的办法就是把导航栏装饰化。
https://stackoverflow.com/questions/28413995
复制相似问题