Btn要记得对状态进行设置

self.catBtn = [UIButtonbuttonWithType:UIButtonTypeSystem];

    self.catBtn.backgroundColor = [UIColorredColor];

    self.catBtn.frame = CGRectMake(75, 22, 90, 30);

    [self.catBtnsetTitle:@"Protocol"forState:UIControlStateNormal];

    self.catBtn.titleLabel.tintColor = [UIColorblackColor];

    [self.catBtnaddTarget:self

                    action:@selector(selectDisplay)

          forControlEvents:UIControlEventTouchDown];

    [navBar addSubview:self.catBtn];

原文地址:https://www.cnblogs.com/sanjianghuiliu/p/3707189.html