2010-04-01 19 views

Odpowiedz

32

W swojej -tableView:cellForRowAtIndexPath:, należy ustawić właściwość accessoryType swojego UITableViewCell do UITableViewCellAccessoryNone, który jest domyślnym FYI.

+1

FWIW, domyślny, czy też nie, miałem to samo pytanie. Prawdopodobnie jest to ustawione w narzędziu Interface/Storyboard Builder i/lub być może (tak jak w moim przypadku) potrzebuję niektórych komórek, aby wskazać więcej szczegółów, a inne nie. Dzięki za odpowiedź! – natevw

1

dla C# użytkownik:

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

Metoda accessoryTypeForRowWithIndexPath jest ** niedostępna w Swift ** – swiftBoy

12

Jeśli używasz konstruktora interfejsu wystarczy wybrać swoją komórkę i ustaw accessory do none.

enter image description here

0

Dla Swift

Dodaj następujący do końca swojej metodzie cellForRowAtIndexPath tuż przed return.

cell.accessoryType = UITableViewCellAccessoryType.None 

to działa idealnie!

0

dla Swift 3

cell.accessoryType = UITableViewCellAccessoryType.none 
Powiązane problemy