僅在iOS 8上滾動時,我的行纔會彼此重疊。我嘗試了與iOS 7有關的類似主題的修復,但我沒有解決我的問題。請參閱附加圖像和我的UITableView GetCell方法。我使用MonoTouch,但邏輯與objective-c相同。iOS 8 TableView在滾動後重疊行
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath)
{
UITableViewCell cell = null;
cell = tableView.DequeueReusableCell(CELL);
if (cell == null)
cell = new UITableViewCell(UITableViewCellStyle.Default, CELL);
if (cell.ContentView.Subviews.Length > 0)
cell.ContentView.Subviews[0].RemoveFromSuperview();
UIView backgroundView = new UIView();
cell.SelectedBackgroundView = backgroundView;
if (list[indexPath.Row] != null)
{
cell.ContentView.AddSubview(list[indexPath.Row].View);
}
return cell;
}
if(cell.ContentView.Subv iews.Length> 0)爲什麼你需要這個如果功能? – Bejibun 2014-09-24 01:39:10
好問題。另一位開發人員將其納入考慮。我猜想只是一個完整的檢查。 – wheels53 2014-09-24 17:37:02