あなたがUITableViewController
これを試しているなら:
TableView.TableFooterView = footer;
アップデート
これについて考えた後、フッターを使用するのではなく、データの最後に余分なセルを使用することをお勧めします。これにより、この効果が得られます。
このメソッドを使用して、最後の項目までスクロールしたかどうかを確認し、テーブルのデータを更新します。
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