uitableiview的重用問題

1. 對於 UITableViewCellAccessoryCheckmark,標記問題

  解決方法:創建一個NsmultableArray 來記錄所選擇的indexpath.row

在創建cell時,判斷

  if ([_checkArray containsObject:[NSNumber numberWithInt:indexPath.row]]) {

        cell.accessoryType = UITableViewCellAccessoryCheckmark;

        

    }else{

        cell.accessoryType = UITableViewCellAccessoryNone;

    }


if else一定要寫全

和創建

if (indexPath.row %2 == 0) {

        cell.backgroundColor = [UIColor greenColor];

    }else{

        cell.backgroundColor = [UIColor clearColor];

    }


else不可缺少

http://www.cocoachina.com/ask/questions/show/1916


http://blog.csdn.net/yesjava/article/details/8075720

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章