0
我在swift 3的tvOS項目中爲我的桌面視圖提供了此代碼,當滾動它時,我想要顏色單元格不聚焦!請能解釋一下怎麼做?在適用的滾動單元格中更改焦點和顏色
這我的代碼
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return tvChannelsArray.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath)
// Show TV Channels names
cell.textLabel?.text = ((tvChannelsArray[(indexPath as NSIndexPath).row] as AnyObject).object(forKey: "channel") as! String)
cell.imageView?.image = UIImage(named: "\(cell.textLabel!.text!)")
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
channelsTableView.isHidden = false;
return 100
}
的tableView說沒有找到如何改變呢? – user1178728