您的位置:首页 > 产品设计 > UI/UE

[ios] UITableVIew单选效果

2013-03-22 10:37 405 查看
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

int newRow=[indexPath row];
int oldRow;
if(self.lastPath==nil)
{
oldRow=-1;
}else {
oldRow=[self.lastPath row];
}
if(newRow!=oldRow)
{
[tableView cellForRowAtIndexPath:indexPath].accessoryType=UITableViewCellAccessoryCheckmark;
[tableView cellForRowAtIndexPath:self.lastPath].accessoryType=UITableViewCellAccessoryNone;

self.lastPath=[indexPath copy];
}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: