2012-01-01 28 views
1

我有一個黑色背景的UITableView,並希望用戶能夠一次選擇多行。 此選擇的默認樣式是該行左側的小灰圈。不幸的是它在黑色背景上不可見。我怎樣才能提供一個自定義的圖像,或將它的外觀設置爲其他東西?UITableViewController更改多個選擇圓的顏色

//this enables a little gray circle to select multiple rows 
self.tableView.allowsMultipleSelectionDuringEditing = YES; 

//my table has black background and the circle is not visible 
self.tableView.backgroundColor = [AppColors tableViewBackgroundColor]; 
self.tableView.separatorColor = [AppColors tableViewBackgroundColor]; 

回答

2

UITableViewCell有兩個屬性稱爲backgroundViewmultipleSelectionBackgroundView。只需使用適當的背景色創建一個視圖,並使用UIImageView來顯示未選擇和選定狀態的自定義圖像。

+0

multipleSelectionBackgroundView更改所選視圖的背景,並保留選中標記。這讓我相信這個複選標記是與單元格相關的其他視圖 – 2012-01-02 02:15:20