UITableView
編集可能モードに変更できます。 しかし問題は、テーブルの下部に追加ボタン (+ ボタン) が表示されることです。最初のセルを意味するテーブルの一番上に移動したいと思います。
これは私が現在設定している方法です
[cell4 setSelectionStyle:UITableViewCellSelectionStyleNone];
int count = 0;
if(self.editing && indexPath.row != 0)
count = 1;
if(indexPath.row == ([arraySongs count]) && self.editing)
{
// count=1;
cell4.lblSong.text=@"Add more";
cell4.lblAlbum.hidden=YES;
cell4.lblArtist.hidden=YES;
return cell4;
}
else
{
cell4.lblSong.text=[[arraySongs objectAtIndex:indexPath.row] valueForKey:@"title"];
cell4.songID=[[[arraySongs objectAtIndex:indexPath.row] valueForKey:@"id"] stringValue];
これをに設定しif(indexPath.row == ([arraySongs count]) && self.editing)
ましたif(indexPath.row == 0 && self.editing)
が、クラッシュします。この + ボタンをテーブルの最初の行に設定する方法。私を助けてください。
ありがとう
アップデート
これはセクションの行数です
`
if(self.editing)
return [arraySongs count]+1;
else
return [arraySongs count];`