私tableView
が編集モードでない場合、ユーザーがセルに触れて強調表示できないようにしたくありません。ただし、allowsSelectionDuringEditing
YES に設定しているため、ユーザーは編集モードでセルを選択できます。
編集モードのときにセルの強調表示されたビューまたは色のみを表示するにはどうすればよいですか?
私tableView
が編集モードでない場合、ユーザーがセルに触れて強調表示できないようにしたくありません。ただし、allowsSelectionDuringEditing
YES に設定しているため、ユーザーは編集モードでセルを選択できます。
編集モードのときにセルの強調表示されたビューまたは色のみを表示するにはどうすればよいですか?
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *CellIdentifier=@"Cell";
UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if(cell==nil){
//YOUR inits
}
if(self.editing){
[cell setSelectionStyle:UITableViewCellEditingStyleNone];
}else
[cell setSelectionStyle:UITableViewCellEditingStyleBlue];
return cell;
}
と
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
if(self.editing)return; //NO ACTION
}