iOS -- 让 cell 单元格 不被选中

来源:互联网 发布:mac游戏怎么退出 编辑:程序博客网 时间:2024/06/16 03:16

1、使用静态单元格时



2、代码实现

//让单元格无法被选中-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{    static NSString *cellIdetify = @"cell";    UITableViewCell *tvCell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdetify] autorelease];      cell.selectionStyle = UITableViewCellSelectionStyleGray;    cell.selectionStyle = NO;    //让单元格无法被选中    此句即可    return cell;}



0 0
原创粉丝点击