2010-04-01 88 views

回答

32

在你-tableView:cellForRowAtIndexPath:,设置您的UITableViewCell到UITableViewCellAccessoryNone,accessoryType属性,它是默认FYI

+1

FWIW,违约与否,我有这个同样的问题。它可能会在Interface/Storyboard Builder中设置,或者(或者像我的情况那样),我需要一些单元格来指示更多细节,而其他细节则不会。尽管谢谢你的回答! – natevw 2014-05-08 21:40:58

1

对于C#用户:

UITableViewCell cell = new UITableViewCell(); 

cell.Accessory = UITableViewCellAccessory.None; 
3
//Write following code into your program 


-(UITableViewCellAccessoryType)tableView:(UITableView *)tv accessoryTypeForRowWithIndexPath (NSIndexPath *)indexPath { 

    return UITableViewCellAccessoryNone; 
} 

//Create a table for different section of app 

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 

cell.accessoryType = UITableViewCellAccessoryNone; 

} 

// VKJ

+0

accessoryTypeForRowWithIndexPath方法在Swift上不可用** – swiftBoy 2016-04-01 09:36:32

12

如果您使用的界面生成器只需选择你的细胞,并设置accessorynone

enter image description here

0

对于斯威夫特

添加下列内容cellForRowAtIndexPath方法刚刚结束 return之前。

cell.accessoryType = UITableViewCellAccessoryType.None 

它只是完美的工作!

0

为雨燕3

cell.accessoryType = UITableViewCellAccessoryType.none