开发者

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.

How to remove arrow in UITableView


//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!!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜