Если вы находитесь в UITableViewController
попробовать это:
TableView.TableFooterView = footer;
UPDATE
После того, как думать об этом, я бы предложил не использовать колонтитул, а скорее дополнительные клетки в конце вашего данных, это получит effect.
Используя этот метод, чтобы проверить, если вы прокручивается до последнего пункта и обновить данные таблицы:
public override void WillDisplay (UITableView tableView, UITableViewCell cell, NSIndexPath indexPath)
{
// if showing last row of last section, load more
if (indexPath.Section == tableView.NumberOfSections()-1 && indexPath.Row == tableView.DataSource.RowsInSection(tableView, indexPath.Section)-1 && !FullyLoaded) {
var growRowSource = tableView.DataSource as GrowRowTableDataSource;
if (growRowSource != null) {
FullyLoaded = growRowSource.LoadNextPage();
Task.Delay (5000);
tableView.ReloadData();
}
}
}
, а затем в Делегирование проверки последнего элемента и создать другую клетку следующим образом:
public override UITableViewCell GetCell (UITableView tableView, Foundation.NSIndexPath indexPath)
{
if (indexPath.Row == LoadedItems.Count) {
var loadingCell = tableView.DequeueReusableCell (LoadingCellID, indexPath) as LoadFooterCell;
loadingCell.Loading = !hasNextPage;
return loadingCell;
}
var cell = tableView.DequeueReusableCell (CellID, indexPath) as GrowRowTableCell;
var item = LoadedItems [indexPath.Row];
// Setup
cell.Image = UIImage.FromFile(item.ImageName);
cell.Title = item.Title;
cell.Description = item.Description;
return cell;
}
bool hasNextPage;
Я быстро издевались пример из GrowTable Xamarin образец кода здесь: https://github.com/b099l3/LoadingTableExample
Нет, я нахожусь в UIViewController, потому что у меня также есть SearchBar и некоторые другие UIViews. У меня есть класс UITableViewSource и пользовательский класс UITableViewCell. – Xhulio
. Я обновил свой ответ с помощью решения, которое может подойти, сообщите мне, есть ли у вас какие-либо проблемы. –