我有一個帶過濾按鈕的UITableView
。如果按下該按鈕,則可能發生該表是空的。爲了通知用戶,我在這種情況下添加了一個tableheader視圖。如果有行要顯示,我將標題設回零。從UITableView中刪除表頭後,還有一個空缺
更新:我不是在談論節標題,我是在談論表頭。
一切都按預期工作,但如果移除了表頭,我發現表格上有一個空白,但之前沒有。任何想法如何擺脫,如果它?
這是代碼:
if(_sections.count == 0) {
UIView *tableHeader = [self getTableHeader]; // make a view
self.tableView.tableHeaderView = tableHeader;
}
else {
self.tableView.tableHeaderView = nil;
[self.tableView reloadData]; // I added this as a test - no luck
}
這是它過濾了所有一切之前的外觀:
這是 「空」 的情況:
這是如果我再次取出過濾器:
你建議,該差距實際上是第一節?因爲我沒有更改節標題代碼,所以我添加了一個表標題... – thst
我不完全確定 - 但添加節標題時,我通常確保處理所有情況下的高度。 雖然我可能會誤解,這是表格視圖的頭部還是部分的頭部? – aduflo
它不是節標題,它是表頭。 – thst