改UITableViewCell的選中狀態(tài)
1. 以為設(shè)置UITableViewCell的selected屬性為True就等于選中
2. 需要用-selectRowAtIndexPath:animated:scrollPosition:方法才能達(dá)到選中效果
-selectRowAtIndexPath:animated:scrollPosition:方法(選中行)
1. 會(huì)令UITableViewCell為選中狀態(tài)
2. 不會(huì)調(diào)用UITableViewDelegate的-(void)tableView:didSelectRowAtIndexPath:方法
-deselectRowAtIndexPath:animated:方法(未選中行)
1. 會(huì)令UITableViewCell為未選中狀態(tài)
2. 不會(huì)調(diào)用UITableViewDelegate的-(void)tableView:didDeselectRowAtIndexPath:方法
-dequeueReusableCellWithIdentifier:(Cell重用)
1. 會(huì)在自動(dòng)釋放池獲取UITableViewCell,樣式是修改后的,不是init樣式
2. 需要重新賦值修改樣式
-dequeueReusableHeaderFooterViewWithIdentifier:(分組頭尾部視圖重用)
1. 受-reloadData方法影響,失去重用功能,要到iOS9版本蘋果才更正
2. 貌似在iOS9以下的作用不大,兼容iOS9以下建議不用
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者