2014-02-18 27 views
0

帶cell.backgroundView的UITableViewCell和self.webSiteTableView.separatorStyle = UITableViewCellSeparatorStyleNone,當我進入editingStyle時,該行出現在帶有紅色背景的DELETE按鈕下。細胞之間沒有線,只有其中的一部分,當我在給editingstyle獲得按鈕下方顯示..UITableViewCell在編輯樣式中出現的分隔線

我幾乎嘗試了一切:

[self.webSiteTableView setSeparatorInset:UIEdgeInsetsMake(0, 0, 0, 0)]; 
self.webSiteTableView.separatorStyle = UITableViewCellSeparatorStyleNone; 
[[UITableView appearance]setSeparatorInset:UIEdgeInsetsZero]; 
self.webSiteTableView.backgroundColor = [UIColor clearColor]; 

cell.contentView.backgroundColor = [UIColor clearColor]; 
cell.backgroundColor = [UIColor clearColor]; 
[cell setBackgroundColor:[UIColor clearColor]]; 

它只是沒有工作......行仍然存在......有沒有辦法讓它消失?謝謝 !

UPDATE:我試了self.webSiteTableView.backgroundColor = [UIColor redColor];變成分隔線確實消失..問題是DELETE按鈕的高度比單元格的高度小...我該如何解決它?我怎樣才能讓按鈕變大? ..

+0

您可以添加自定義分隔這樣http://stackoverflow.com/a/21249030/1294448 –

+0

'[UITableView的外觀] setSeparatorInset:UIEdgeInsetsZero]'有什麼用,當你這個代碼不使用分隔符。 –

+0

我試過self.webSiteTableView.backgroundColor = [UIColor redColor];變成分隔線確實消失..問題是DELETE按鈕的高度比單元格的高度小...我該如何解決它?我怎樣才能讓按鈕變大? .. –

回答

1

交換兩個語句的順序。先設置顏色,然後插入:

self.tableView.separatorColor = [UIColor clearColor]; 
self.tableView.separatorInset = UIEdgeInsetsZero; 
+0

我試了self.webSiteTableView.backgroundColor = [UIColor redColor];變成分隔線確實消失..問題是DELETE按鈕的高度比單元格的高度小...我該如何解決它?我怎樣才能讓按鈕變大? .. –

0

我有同樣的問題,試圖隱藏分隔符。 我使用下面的委託方法來解決它。

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { 
    // This will create a "invisible" footer 
    return 0.01f; 
} 
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section 
{ 
    return [UIView new]; 

    // If you are not using ARC: 
    // return [[UIView new] autorelease]; 
} 
+0

我試過self.webSiteTableView.backgroundColor = [UIColor redColor];變成分隔線確實消失..問題是DELETE按鈕的高度比單元格的高度小...我該如何解決它?我怎樣才能讓按鈕變大? .. –

+0

是的,你可以做到這一點。如果您搜索過,您可以輕鬆找到它。紐約的方式,請通過這個鏈接它會有所幫助:http://stackoverflow.com/questions/19281834/ios-7-uitableviewcontroller-changing-replacing-delete-button –

相關問題