2015-05-29 75 views
-5

如何在swift中更改tableview中节的textcolor。如何在swift中更改tableView节中的文本颜色

viewForHeaderInSection

+1

你会发现有用的手册! SO不是Google的代理。 https://developer.apple.com/library/ios/documentation/UIKit/Reference/UILabel_Class/#//apple_ref/occ/instp/UILabel/textColor。 –

回答

1
override func tableView(tableView: UITableView!, viewForHeaderInSection section: Int) -> UIView! { 


var customView:UIView? 
customView.frame = // set frame according to tableview width and header height 
customView.backgroundColor = UIColor.greenColor() 
return customView 
} 

希望这会帮助你。