0

私のアプリは、UITableview を使用して画像のフィードを表示します。APIは一度に非常に多くの画像しか提供しないため、テーブルビューの最後のセルをLoad More Button. LoadMoreCellこれを行うために、識別子で呼び出されるカスタムセルを作成しましたLoadCell

私が行う方法を使用しGetCellて:

    public override UITableViewCell GetCell (UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
    {
        // request a recycled cell to save memory
        FeedCell cell = tableView.DequeueReusableCell (cellIdentifier) as FeedCell;

        if(indexPath.Row >= tableItems.Count)
        {
            LoadMoreCell loadCell = tableView.DequeueReusableCell ("LoadCell") as LoadMoreCell;
            return loadCell;
        }
        //Set Date and title
        cell.SetInfo (ids[indexPath.Row], userID, tableItems [indexPath.Row]);
        cell.SetImage (images[indexPath.Row]);
        cell.parent = this.parent;
        return cell;
    }

これにより、下部に のセルが表示されますが、セルは aの小さい寸法ではなくLoad More Buttonと同じ寸法です。FeedCellLoadMoreCell

これで私の問題が何であるか知っている人はいますか?

4

2 に答える 2

2

UITableViewSource で GetHeightForRow をオーバーライドする必要がある場合があります

public override float GetHeightForRow (UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
{
     if (indexPath.Row >= tableItems.Count) {
           return loadMoreHeight;
     } else {
           return regularRowHeight;
     }
}
于 2013-05-29T21:47:32.813 に答える
0

UITableViewDelegate にはメソッド tableView:heightForRowAtIndexPath: があり、そこでセルの高さを返すことができます。

于 2013-05-29T21:46:18.360 に答える