UIButton

UIButton *btnTrans = [UIButton buttonWithType:UIButtonTypeCustom];

[btnTrans setBackgroundImage:[UIImage imageNamed:@"btnAround.png"] forState:UIControlStateNormal];

[btnTrans setTitle:@"周边" forState:UIControlStateNormal];

[btnTrans setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];

btnTrans.titleLabel.font = [UIFont systemFontOfSize:12];

btnTrans.frame = CGRectMake(0.0, 0.0, 50, 31);

[btnTrans addTarget:self action:@selector(backBtnAction:) forControlEvents:UIControlEventTouchUpInside];

tempButton = [[UIBarButtonItem alloc] initWithCustomView:btnTrans];

   //tempButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"btnAround.png"] style:UIBarButtonItemStyleDone target:self action:@selector(backBtnAction:)];

self.navigationItem.leftBarButtonItem = tempButton;

posted on 2011-08-18 18:05  风乔  阅读(189)  评论(0编辑  收藏  举报

导航