嘿,我得到一個非常奇怪的錯誤,我無法弄清楚如何解決它:當我在UITableView中滾動時,它有時會突出顯示藍色的單元格,即使當我沒有完全選擇。UITableViewCell在滾動時變成藍色
例如:
- 細胞1-
- 細胞2-
- 細胞3-
- 細胞4-
如果我把手指向下在小區2和滾動到小區4會留下單元格2突出顯示,即使didSelectRowAtIndexPath:從不被觸發。
任何想法?
編輯 添加代碼:
UITableViewCell *cell = nil;
static NSString *cellId = @"StyleDefault";
cell = [tableView dequeueReusableCellWithIdentifier:cellId];
if (cell == nil) {
cell = [[[UITableViewCell alloc]
initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId] autorelease];
}
cell.textLabel.text = @"Cell One";
cell.textLabel.textAlignment = UITextAlignmentCenter;
[cell setAccessoryView:nil];
return cell;
你能告訴我們cellForRowAtIndexPath中的單元格創建代碼嗎? – 2011-04-18 06:39:03
請告訴我們你在'CellForRowAtIndexPath'委託中做了什麼? – 2011-04-18 06:45:49