开发者

How to draw outline in selected tableviewcell in iphone

开发者 https://www.devze.com 2023-04-09 04:18 出处:网络
I want to outline Uitableview\'s selected cell can anyone te开发者_运维技巧ll me how to do this ?

I want to outline Uitableview's selected cell

can anyone te开发者_运维技巧ll me how to do this ?

searched but nothing worked till now :(

should I do anything in rowdidselect method?


Try setting the allowsSelectionDuringEditing property on the UITableView to YES - the default is NO

For More

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [self doSomethingWithRowAtIndexPath:indexPath];
}

What I understand from your question is u want to change the look off the selected cell... On didSelectRowAtIndexPath Event you have the index off that row by that index draw a New CELL off your desire.


You can create a custom uiview and override the drawrect method so that it will create border lines across the given rect. Add this view to the cell.contentview when didSelectrow method is getting invoked.


I think you need to subclass your UITableViewCell. Then in the drawRect method you can draw that.

- (void) drawRect : (CGRect)rect
{
    [super drawRect:rect]; 
    if (self.selected)
    {
      // put one image as outline  
    } 
} 

I hope this might help you.
Naveen

0

精彩评论

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

关注公众号