IOS中导航的返回按钮定制

- (void)addBackItemWithAction:(SEL)action {
    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 80, 44)];
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(0, 0, 64, 44);
    [button setImage:[UIImage imageNamed:@"ic_back_nor"] forState:UIControlStateNormal];
    [button setTitle:@"返回" forState:UIControlStateNormal];
    [button setImageEdgeInsets:UIEdgeInsetsMake(0, -13, 0, 13)];
    [view addSubview:button];
    UILabel *label = [HYBControlMaker labelWithFrame:CGRectMake(10, 0, 34, 44) text:@"返回" textColor:[UIColor whiteColor] font:[UIFont boldSystemFontOfSize:15]];
    [view addSubview:label];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:view];
    return;
}

上一篇:django get和post提交表单方式


下一篇:虚拟化C-RAN的概念证明验证 | 带你读《5G系统关键技术详解》之九