我的應用程序包含一個UITableView
它有部分頁腳。當用戶滾動到tableView的底部時,有時會在最後一個單元格和tableFooter之間出現分隔符插入。這種行爲是不一致的。UITableView底部分隔符插入 - 在IOS 7中的奇怪行爲
有沒有辦法迫使該分離器總是出現或不會出現?你們有沒有注意到這種不一致的行爲?對我來說就像一個錯誤。
編輯
我使用
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
UILabel *footer = [[UILabel alloc] init];
footer.backgroundColor = [UIColor whiteColor];
footer.font = [footer.font fontWithSize:15];
footer.textAlignment = NSTextAlignmentCenter;
return footer;
}
,但你可以很容易地重現同樣的問題只能用
- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section;
你在'viewForFooter ...'中的代碼是什麼? – Fogmeister
您是否得到了解決方案? –
我建議你跳過默認tableView分隔符瘋狂,並將其設置爲不可見: [_tableView setSeparatorColor:[UIColor clearColor]];然後,簡單地將UIView子視圖添加到每個單元格,這將與框架CGRectMake(0,0,_tableview.frame.size.width,1),然後也隱藏它,如果單元格行是0.這樣,它也將更加一致與以前的iOS版本,也可以使用自定義分隔線圖像(如果需要..)或自定義顏色或從兩側插入位置。 –