2

私は私の 2 つの間にセパレーターを持ちたいと思いUITableViewRowActionsます。これは、私のアプリがどのように見えるかの例です (これは Fitbit のアプリからのものです):

Fitbit 画像

これが私の外観です:

私のイメージ

アクションのコードは次のとおりです。

override func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool {
return true
}

override func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [UITableViewRowAction]? {
let delete = UITableViewRowAction(style: .Default, title: "Delete") { (action, indexPath) in
   //Code for deleting
}
let edit = UITableViewRowAction(style: .Default, title: "Edit") { (action, indexPath) in
    //Code for editing
}
edit.backgroundColor = UIColor(red: 0, green: 128/225, blue: 128/225, alpha: 1)
return [delete, edit]
}

どうすればこのセパレーターを実現できますか? ご協力ありがとうございました。

4

0 に答える 0