当前位置: 移动技术网 > 移动技术>移动开发>IOS > iOS - UIButton按钮发生事件

iOS - UIButton按钮发生事件

2018年03月03日  | 移动技术网移动技术  | 我要评论

UIButton

按钮发生事件

- (IBAction)clickRedButton
{
    // 改变文字颜色
    self.label.textColor = [UIColor redColor];
    // 改变文字内容
    self.label.text = @"我是红色";
    // 改变文字背景颜色
    self.label.backgroundColor = [UIColor greenColor];
    // 改变文字对齐方式NSTextAlignmentCenter:居中,NSTextAlignmentRight:靠右,NSTextAlignmentLeft:靠左
    self.label.textAlignment = NSTextAlignmentCenter;
    // 改变文字大小
    self.label.font = [UIFont systemFontOfSize:30.f];
}

这里写图片描述

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网