码迷,mamicode.com
首页 > 其他好文 > 详细

navigationitem的背景图片和左边返回按钮 以及文字

时间:2014-08-22 17:57:29      阅读:214      评论:0      收藏:0      [点我收藏+]

标签:des   style   color   io   for   ar   cti   line   size   



[self.navigationController.navigationBar setBackgroundImage:imag forBarMetrics:UIBarMetricsDefault];


//button 定义你要的背景 文字 或 事件

 UIBarButtonItem *leftBarButton = [[UIBarButtonItem allocinitWithCustomView:button];

 self.navigationItem.leftBarButtonItem = leftBarButton;

 [leftBarButton release];



具体实现:

[self.navigationItem setTitle:@"通知详情"];

    //self.navigationController.navigationBarHidden = NO;

    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"root_top.png"] forBarMetrics:UIBarMetricsDefault];

    self.navigationItem.hidesBackButton = YES;

    

    UIButton *rightButton = [[UIButton alloc]initWithFrame:CGRectMake(SCREEN_WIDTH - 70, 10, 70, rootTopHeight - 20)];

    [rightButton addTarget:self action:@selector(NoticeBackAction) forControlEvents:UIControlEventTouchUpInside];

    [rightButton setBackgroundImage:[UIImage imageNamed:@"root_back.png"] forState:UIControlStateNormal];

    [rightButton setTitle:@"退出" forState:UIControlStateNormal];

    UIBarButtonItem *rightBarButton = [[UIBarButtonItem alloc]initWithCustomView:rightButton];

    self.navigationItem.rightBarButtonItem = rightBarButton;


navigationitem的背景图片和左边返回按钮 以及文字

标签:des   style   color   io   for   ar   cti   line   size   

原文地址:http://blog.csdn.net/huang2009303513/article/details/38758629

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!