改變顯示工具欄菜單的字體大小對於下面的圖片:從編程迅速
如何增加字體大小?
這是BackTableVC.swift
代碼:
import Foundation
class BackTableVC: UITableViewController {
var tableArray = [String]()
override func viewDidLoad() {
tableArray = ["event log", "my details", "research", "share", "checklists", "templates", "helpful links", "feedback"]
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return tableArray.count;
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: tableArray[indexPath.row], for: indexPath) as UITableViewCell
cell.textLabel?.text = tableArray[indexPath.row]
cell.textLabel?.textColor = UIColor.white
return cell
}
如何增加字體大小?有任何想法嗎?
http://stackoverflow.com/questions/7957215/how-can-i-change-the-font-size-of-my-uitableview-cell-title –
您可以直接使用此cell.textLabel.font = UIFont(name:「Avenir-Book」,size:15.0) – Aditya
將'cell.textLabel?.font = [UIFont systemFontOfSize:16.0];'添加到'tableView'函數中。您可以將16.0更改爲任何其他您喜歡的字體大小。 – SimpleBeat