7
A
回答
15
你可能設置分隔符插圖爲0,無論是在代碼或Interface Builder中(可以在屬性檢查器中找到:
這也導致了職稱沒有插圖,默認值是左邊的15和右邊的0
+1
謝謝!我沒有這樣做在IB,但我打電話「」「如果([self.tableView respondsToSelector:@selector(separatorInset)] { [self.tableView setSeparatorInset:UIEdgeInsetsZero]; }」「」 – stackOverFlew 2014-12-19 09:29:40
4
[你可以發佈你的代碼UITableViewDelegate
? 在UITableView
,沒有API可以在部分標題中設置此插頁,因此您可以返回tableView:viewForHeaderInSection:
中的自定義UIView
,然後設置所需的佈局。
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { UIView *headerView = [UIView alloc] init]; UILabel *headerLabel = [UILabel alloc] init]; headerLabel.text = @"xxx"; [headerLabel sizeToFit]; headerLabel.frame = CGRectMake(20, 0, CGRectGetWidth(headerLabel.frame), CGRectGetHeight(headerLabel.frame)); [headerView addSubview:headerLabel]; headerView.frame = CGRectMake(0, 0, CGRectGetWidth(tableView.bounds), CGRectGetHeight(headerLabel.frame)); return headerView; }
相關問題
- 1. swift - UITableView節插入
- 2. 插入點缺失
- 3. 滾動時UITableView節頭視圖消失
- 4. UITableView節頭iOS 5
- 5. 鏈表插入/缺失
- 6. 插入時缺失記錄
- 7. Oracle插入缺失記錄
- 8. 插值與插入符號缺失值
- 9. Unicode - 缺失箭頭
- 10. 將節頭添加到UITableView
- 11. UITableView節頭不可見
- 12. UITableView節頭是全黑
- 13. 垂直的UITableView節頭
- 14. UITableView單元格插入失敗
- 15. 導入CSV到Neo4j的缺失節點
- 16. 與缺失環節
- 17. 僅在MySQL中插入缺失數據
- 18. sql服務器插入缺失記錄
- 19. 使用Lodash插入缺失數據
- 20. Python defaultdict不插入缺失值
- 21. 用連接插入缺失的行
- 22. 在JavaScript中插入「缺失的年份」?
- 23. 插入缺失日期,水晶報表
- 24. 在列表的開頭插入節點
- 25. 在鏈表的開頭插入節點
- 26. 插入BST無頭節點JAVA
- 27. r - 插入缺失的每月數據行並插入
- 28. 甲骨文批插入瓦特/沒有主鍵缺失插入
- 29. 缺少Maven插件碼頭
- 30. 的UITableView tableHeaderView的缺失分離
您是否試過去尺寸檢查器並更改標頭的高度? – 2014-12-19 08:09:04
不,嘗試過但它沒有幫助。雖然謝謝! – stackOverFlew 2014-12-19 08:15:28