garaster 于 2012.09.21 10:40 提问
-
- MrsSeven7 2012.09.21 13:44
- 已采纳
如果用UINavigationController:
1.改变导航条背景图:
[self.navigationController.navigationBar setBackgroundImageForBarMetrics:]
2.左右button的设置:
[self.navigationItem setLeftBarButtonItem:],[self.navigationItem setRightBarButtonItem:]
需要去掉边框。
3.设置中间的三个button:
UIView *buttonView= [[UIView alloc] initWithFrame:CGRectMake(0, 0, 180, 40)];
UIButton *button1= [UIButton buttonWithType:UIButtonTypeCustom];
button1.imageView.image= [UIImage imageNamed:@"button1.png"];
button1.frame= CGRectMake(0, 0, 40, 40);
UIButton *button2= [UIButton buttonWithType:UIButtonTypeCustom];
button2.imageView.image= [UIImage imageNamed:@"button2.png"];
button2.frame= CGRectMake(70, 0, 40, 40);
UIButton *button3= [UIButton buttonWithType:UIButtonTypeCustom];
button3.imageView.image= [UIImage imageNamed:@"button3.png"];
button3.frame= CGRectMake(140, 0, 40, 40);
[buttonView addSubview:button1];
[buttonView addSubview:button2];
[buttonView addSubview:button3];
self.navigationItem.titleView= buttonView;
大小自己调。
-
- lwq421336220 2012.10.10 12:03
搂上的方法中规中矩,不错。你也可以试试自己定义一个导航条,然后去添加。关于自定义导航条,自己去搜索一下,网上很多的,有问题先去搜一搜,再提问,会提高解决问题的能力。
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!