我使用多行選擇選項進行tableview。所以,我使用了複選標記附件類型的動作。我還需要編輯/重命名所選行中的文本。桌面與檢查標記和詳細信息一起公開
基本上,我需要把左邊的複選標記(複選框)和細胞右側的詳細公開內容都用到。
下面的代碼是對號,我有,目前勾選出現在單元格的右側。
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
// Navigation logic may go here. Create and push another view controller.
TSIPAppDelegate *appDelegate = (TSIPAppDelegate *)[[UIApplication sharedApplication]delegate];
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
NSString *cellText = cell.textLabel.text;
if (cell.accessoryType==UITableViewCellAccessoryNone)
{
cell.accessoryType=UITableViewCellAccessoryCheckmark;
appDelegate.selectedFile = cellText;
if (prevSP!=indexPath.row) {
cell=[tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:prevSP inSection:0]];
cell.accessoryType=UITableViewCellAccessoryNone;
prevSP=indexPath.row;
}
}
else if (prevSP!=indexPath.row){
cell.accessoryType=UITableViewCellAccessoryNone;
}
}
有什麼建議嗎?
當行選擇時,勾選要啓用/禁用和選定披露按鈕,它應該打開編輯所選行的新觀點。
你可以請包括你有的代碼嗎?這會讓其他人更好地理解你現在擁有的東西。 – Jesse 2013-02-23 05:13:27
@Jesse:我已經添加了代碼。請檢查。有關詳情披露,尚未撰寫。 – Arun 2013-02-23 05:22:02
@Arun更好的方法是UITableViewCellAccessoryCheckmark而不是你都不能添加在每個單元和附件類型,因爲每個細胞 – Dany 2013-02-23 05:54:14