0
다른 섹션이 포함 된 UITableView가있는 앱이 있습니다. 처음 세 섹션, 즉 색인 경로 0, 1 및 2에만 액세스를 허용하고 싶습니다. 내 문제는 앱이 실행될 때 내 코드가 작동한다는 것입니다. 그러나 테이블 뷰 섹션을 아래로 스크롤하여 테이블 뷰 섹션의 맨 위로 스크롤 할 때 0, 1 및 2는 다시 올 때 사용할 수 없습니다. 이 문제를 어떻게 해결할 수 있습니까?내 tableview를 스크롤 할 때 활성 tableView 셀이 계속 비활성화됩니다.
//formatting the cells that display the sections
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("cell") as UITableViewCell!
cell.textLabel?.text = sectionName[indexPath.row]
cell.textLabel?.textAlignment = .Center
cell.textLabel?.font = UIFont(name: "Avenir", size:30)
//Code to block disable every section after row 3.
if (indexPath.row >= 2) {
cell.userInteractionEnabled = false
cell.contentView.alpha = 0.5
}
return cell
}
감사합니다. – pete800