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];

posted @ 2014-05-04 15:43  三江汇流  阅读(183)  评论(0编辑  收藏  举报