2012-11-09 40 views
0

我正在使用tableView分組樣式。我的DisclosureButton沒有顯示在我的表格單元格中。我失蹤了什麼?UITableViewCellAccessoryDe​​tailDisclosureButton單元格中未顯示

THANKS

- (UITableViewCell *)tableView:(UITableView *)tableView 
    cellForRowAtIndexPath:(NSIndexPath *)indexPath { 
static NSString *SimpleTableIdentifier = @"SimpleTableIdentifier"; 

NSArray *listData =[self.tableContents objectForKey:[self.sortedKeys objectAtIndex:[indexPath section]]]; 

UITableViewCell * cell = [tableView 
          dequeueReusableCellWithIdentifier:SimpleTableIdentifier]; 

if(cell == nil) { 

    cell = [[[UITableViewCell alloc] 
    initWithStyle:UITableViewCellStyleDefault 
    reuseIdentifier:SimpleTableIdentifier] autorelease]; 


} 

NSUInteger row = [indexPath row]; 

cell.textLabel.text = [listData objectAtIndex:row]; 

    // cell.backgroundColor=[UIColor brownColor]; 

    cell.accessoryType =UITableViewCellAccessoryDetailDisclosureButton; 



return cell; 
} 

enter image description here

+0

是否在非編輯模式下顯示按鈕顯示? –

回答

2

你的表似乎是在編輯狀態。您應該在編輯模式下設置accessoryType。

cell.editingAccessoryType=UITableViewCellAccessoryDetailDisclosureButton; 
+0

好..我認爲這是完美的答案,我的DetailDisclosureButton現在顯示:)感謝 – QueueOverFlow

+0

+1爲簡單修復:) –

0

UITableView在編輯模式下隱藏配件按鈕。 所以如果你想顯示它,你需要自定義UITableViewCell。 或者你可以這樣做,就像 Vito Limandibhrata

相關問題