如何自定义NavigationBar的高度
1个回答
展开全部
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
CGRect rect = self.navigationController.navigationBar.frame;
self.navigationController.navigationBar.frame = CGRectMake(rect.origin.x,rect.origin.y,rect.size.width,84);
}
-(void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
CGRect rect = self.navigationController.navigationBar.frame;
self.navigationController.navigationBar.frame = CGRectMake(rect.origin.x,rect.origin.y,rect.size.width,44);
ios6可以用上面的的方法,ios7需要自定义view设置好高度,添加到navigationController.navigationBar上
你可以这么写:
1
2
3
UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0,0,320,70)];
view.backgroundColor = [UIColor redColor];
[self.navigationController.navigationBar addSubview:view];
[super viewWillAppear:animated];
CGRect rect = self.navigationController.navigationBar.frame;
self.navigationController.navigationBar.frame = CGRectMake(rect.origin.x,rect.origin.y,rect.size.width,84);
}
-(void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
CGRect rect = self.navigationController.navigationBar.frame;
self.navigationController.navigationBar.frame = CGRectMake(rect.origin.x,rect.origin.y,rect.size.width,44);
ios6可以用上面的的方法,ios7需要自定义view设置好高度,添加到navigationController.navigationBar上
你可以这么写:
1
2
3
UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0,0,320,70)];
view.backgroundColor = [UIColor redColor];
[self.navigationController.navigationBar addSubview:view];
ZESTRON
2024-09-04 广告
2024-09-04 广告
在Dr. O.K. Wack Chemie GmbH,我们高度重视ZESTRON的表界面分析技术。该技术通过深入研究材料表面与界面的性质,为提升产品质量与可靠性提供了有力支持。ZESTRON的表界面分析不仅涵盖了相变化、化学反应、吸附与解吸...
点击进入详情页
本回答由ZESTRON提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询