我有自定義單元格與一個按鈕的紅色與標題驗證和點擊它改變爲綠色與標題Experience.But問題是我滾動未點擊按鍵都轉變爲綠色色彩搭配題經驗桌面視圖自定義單元格按鈕顏色和標題更改在桌面視圖上的滾動
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell1";
BoastsMainCell1 *cell1 =
(BoastsMainCell1*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
cell1.selectionStyle = UITableViewCellSelectionStyleNone;
if(cell1 == nil) {
cell1 = [[BoastsMainCell1 alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
[cell1.verifyBnt addTarget:self action:@selector(verifyButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
return cell1;
}
-(void)verifyButtonClicked:(UIButton*)sender
{
[sender setTitle:@"Experience" forState:UIControlStateNormal];
sender.backgroundColor=[UIColor greenColor];
}
新蜜蜂可以üPLZ添加一些示例代碼 – salman4siddiquistackoverflow
[超prepareForReuse]其給出的錯誤 – salman4siddiquistackoverflow
沒有可見的接口聲明選擇器.. ?? – salman4siddiquistackoverflow