iOS:Button.titleLabel.text

来源:互联网 发布:php如何检测usbkey 编辑:程序博客网 时间:2024/06/04 07:43

在代码中对button上的字进行设置,我们可以通过:

m_addButton.titleLabel.font = [UIFont systemFontOfSize: 7];m_addButton.titleLabel.textColor = [UIColor blackColor];         m_addButton.titleLabel.textAlignment = UITextAlignmentRight;

但是改变上面的字的时候不能用  m_addButton.titleLabel.text = @"Add Stuff";

而是要通过   [m_addButton setTitle:@"Add Stuff" forState: UIControlStateNormal];

0 0
原创粉丝点击