2017-06-05 70 views
0

我想添加複選標記到我的UItableview單元格。我想對號對這樣的形象左旁顯示像圓圈按鈕:UITableView左邊的複選標記按鈕 - 斯威夫特

enter image description here

我無法獲得在左邊的選中標記我的代碼,而是我一直在右側獲得複選標記是僅在點擊時顯示。這是我現在的代碼:

override func tableView(tableView: UITableView, didDeselectRowAtIndexPath indexPath: NSIndexPath) { 
if let cell = tableView.cellForRowAtIndexPath(indexPath) { 
    cell.accessoryType = .None 
} 
} 
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { 
if let cell = tableView.cellForRowAtIndexPath(indexPath) { 
    cell.accessoryType = .Checkmark 

} 
} 

任何想法,我怎麼能得到複選標記顯示在左邊像圖像?

回答

0

我已經爲你製作了完整的示例應用程序。

just try this. 這就是它的樣子。 enter image description here

+1

希望你能把它轉換成swift。:)它只是一種語言。 –

+0

elk_cloner它看起來像項目已經在迅速:) – ajayb

+0

哦!我做到了,我忘了。 :) –