2010-04-01 40 views

Trả lời

32

Trong số -tableView:cellForRowAtIndexPath:, đặt thuộc tính accessoryType của UITableViewCell thành UITableViewCellAccessoryNone, là mặc định FYI.

+1

FWIW, mặc định hay không, tôi đã có câu hỏi này tương tự. Nó có thể được thiết lập trong giao diện/Storyboard Builder, và/hoặc có lẽ (như trong trường hợp của tôi) Tôi cần một số tế bào để chỉ ra chi tiết hơn và những người khác thì không. Cảm ơn vì câu trả lời! – natevw

1

Đối với C# sử dụng:

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 method is ** không khả dụng trên Swift ** – swiftBoy

12

Nếu bạn đang sử dụng giao diện người xây dựng chỉ cần chọn di động của bạn và thiết lập accessory để none.

enter image description here

0

Đối Swift

Add sau để cuối của phương pháp cellForRowAtIndexPath bạn ngay trước khi return.

cell.accessoryType = UITableViewCellAccessoryType.None 

nó hoạt động hoàn hảo !!

0

cho Swift 3

cell.accessoryType = UITableViewCellAccessoryType.none 
Các vấn đề liên quan