Расширение ячейки табличного представления Xamarin для iOS приводит к скольжению заголовков нижней части - PullRequest
0 голосов
/ 10 октября 2018

Gif проблемы

public override async void RowSelected(UITableView tableView, NSIndexPath indexPath)
{

   tableView.DeselectRow(indexPath,true);
   var myCell = _cellDataDict[_cellSectionList[indexPath.Section]][indexPath.Row];

   myCell.IsSelected = !myCell.IsSelected;

   if( _previousCell != null && _previousCell != myCell)
       _previousCell.IsSelected = false;


   tableView.BeginUpdates();
   tableView.EndUpdates();

   tableView.ScrollToRow(indexPath, UITableViewScrollPosition.Top, true);
}


public override nfloat GetHeightForRow(UITableView tableView, NSIndexPath indexPath)
{
   var myCell = _cellDataDict[_cellSectionList[indexPath.Section]][indexPath.Row];

   if(myCell.IsSelected)
       return 293.0f;
   else
       return 68.0f;
}

public override nfloat GetHeightForHeader(UITableView tableView, nint section)
{
    return 44.0f;
}

public override nfloat EstimatedHeightForHeader(UITableView tableView, nint section)
{
    return 44.0f;
}

public override nfloat EstimatedHeight(UITableView tableView, NSIndexPath indexPath)
{
   var myCell = _cellDataDict[_cellSectionList[indexPath.Section]][indexPath.Row];

   if(myCell.IsSelected)
       return 293.0f;
   else
       return 68.0f;
}

По сути, я хочу добиться расширения ячейки табличного представления, а затем прокрутить ее до верхней части табличного представления после ее расширения.Но анимация сейчас выглядит странно, и я хочу сгладить ее.Похоже, что заголовок нижнего раздела скользит вверх, хотя там уже есть копия.

...