标签:
iOS设置导航按钮
navigationBar中包含了这几个重要组成部分:leftBarButtonItem, rightBarButtonItem, backBarButtonItem, title。
下面是代码
//设置右Btn UIButton *rightBtn = [[UIButton alloc] initWithFrame:CGRectMake(2, 2, 40, 40)]; [rightBtn setTitle:@"搜索" forState:UIControlStateNormal]; [rightBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithCustomView:rightBtn]; [self.navigationItem setRightBarButtonItem:rightItem];
标签:
原文地址:http://www.cnblogs.com/wlsxmhz/p/5408720.html