【发布时间】:2012-08-31 23:24:45
【问题描述】:
我正在UITableView 中创建UIButton:
UIButton *aboutButton=[UIButton buttonWithType:UIButtonTypeRoundedRect];
[aboutButton setTitle:@"ABOUT" forState:UIControlStateNormal];
[aboutButton addTarget:self action:@selector(aboutButtonClicked) forControlEvents: UIControlEventTouchUpInside];
aboutButton.frame=CGRectMake(20, 375, 200, 35);
[tableView addSubView aboutButton];
按钮工作正常......但按钮文本为蓝色且居中对齐。我想更改文本颜色和对齐方式 - 我该怎么做?
【问题讨论】:
-
这真的应该可以通过点击查看
UIButton和UILabel类引用来解决,没有必要在SO上发布这个。您可以在 Xcode 或网络上查看文档,它们非常简单明了。