您的位置:首页 > 其它

自定义导航栏

2015-10-28 15:38 197 查看

自定义titleView

UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, 150, 30)];
[textField setBorderStyle:UITextBorderStyleRoundedRect];
[textField setTextAlignment:UITextAlignmentLeft];
[textField setPlaceholder:@"搜索"];

self.navigationItem.titleView = textField;


自定义导航栏右侧按钮

UISwitch *simpleSwitch = [[UISwitch alloc] init];
simpleSwitch.on = YES;
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:simpleSwitch];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: