How to remove arrow in UITableView
I am working on a UITableView
. Please tell me how开发者_开发技巧 to remove the arrow button displayed in the each and every row?
In your -tableView:cellForRowAtIndexPath:
, set the accessoryType
property of your UITableViewCell to UITableViewCellAccessoryNone, which is the default FYI.
If you are using the interface builder just select your cell and set the accessory
to none
.
//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
For c# user :
UITableViewCell cell = new UITableViewCell();
cell.Accessory = UITableViewCellAccessory.None;
for Swift 3
cell.accessoryType = UITableViewCellAccessoryType.none
For Swift
Add following to end of your cellForRowAtIndexPath
method just before
return
.
cell.accessoryType = UITableViewCellAccessoryType.None
it just works perfect!!
精彩评论