2011-12-27 65 views

回答

1

在數組中存儲按鈕的狀態,並且在加載單元格時,檢查數組中該單元格的狀態並正確設置按鈕。

0

其實它的重載問題。所以我的建議是

cellForRowAtIndexPath

if(cell == nil){ 
................. 
alloc your button and give him a tag 

[cell.contentview addSubview yourbutton]; 
................. 
} 
yourbutton = (uibutton*)[cell.contentview viewwithtag:buttontag]; 

if(indexPath.row == your expected index && buttonchangedBolean == YES){ 

yourbutton.backgroundimage = [uiimage imagenamed:@"imagename.png"]; 
} 

如果你不明白再敲我沒有任何猶豫,這只是一個建議給你。如果您發佈了代碼,我可以給您一個解決方案。無論嘗試我當前的建議,它可能會幫助您。

+0

此代碼無效 – 2011-12-27 07:29:47

+0

這不是確切的代碼它只是一個建議 – Emon 2011-12-27 08:04:15

+0

發佈一些代碼,然後我會編輯它 – Emon 2012-01-03 11:23:47