现在的位置: 首页 > 综合 > 正文

UIButton

2012年04月02日 ⁄ 综合 ⁄ 共 754字 ⁄ 字号 评论关闭

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;

抱歉!评论已关闭.