2017-06-20 18 views
0

下の画像から、複数の選択ボタンの色と選択中の背景色(青色部分)を変更したいと思います。UITableViewの編集スタイルを変更するには?

editingStyleが

-(UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    return UITableViewCellEditingStyleDelete|UITableViewCellEditingStyleInsert; 
} 

以下に定義されるIは、のtableViewのtintColor、変化複数の選択ボタンの色を設定しようとしたが、背景色は変化しません。

enter image description here

+0

あなたは何を試してみましたか?あなたのコードはどこですか? – Raptor

答えて

1

あなたは、各セルのtintColormultipleSelectionBackgroundViewを変更する必要があります。

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 
    //... 

    cell.tintColor = UIColor.orange 

    let bgview = UIView() 
    bgview.backgroundColor = UIColor.purple 
    cell.multipleSelectionBackgroundView = bgview 

    //... 
} 

sample

関連する問題