ios8 如果UITableView只設(shè)置viewForHeaderInSection,則可能section不能顯示,iOS7及以下版本顯示正常。
解決方案:
設(shè)置heightForHeaderInSection。
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ return 22;//自定義高度}
另外,
如果代碼中設(shè)置了titleForHeaderInSection,則不需要上面的設(shè)置也可以正常顯示。
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section;
新聞熱點
疑難解答