ios UIButton 文字透明度设置

[self.navBar.rightButton2 setTitleColor:TFCOLOR_0093FF forState:UIControlStateNormal];
    [self.navBar.rightButton2 setTitleColor:[UIColor colorWithRed:0 green:(9.0*16+3.0)/255.0 blue:1.0 alpha:0.5] forState:UIControlStateDisabled];


- (void)setRightButtonEnable:(BOOL)a{
    if (a) {
        self.navBar.rightButton2.enabled = a;
    } else{
         self.navBar.rightButton2.enabled = a;
    }
}

设置UIButton的enable属性后,设置文字的透明度。

猜你喜欢

转载自blog.csdn.net/robinson_911/article/details/81665475