UITableView
カスタム セル (UItableViewCell
サブクラス)を持つを使用したゲームを開発しています。
編集モードの場合:の並べ替えコントロールのみがUITableView
表示されます。
現在、削除と並べ替えのコントロールを取得しています。
編集中に並べ替えコントロールのみを取得するにはどうすればよいですか?
ベストアンサー1
この回答は遅いかもしれませんが、まだ必要としている人のために掲載しています。次のメソッドを実装するだけです。
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
return YES;
}
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
return UITableViewCellEditingStyleNone;
}
- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath {
return NO;
}
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
return YES;
}
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath{
}