【发布时间】:2013-03-28 16:08:33
【问题描述】:
我正在尝试在表格视图中添加带有按钮的页脚视图。我在网上找到了这段代码
public override UIView GetViewForFooter(UITableView tableView, int sectionIndex)
{
// Write a method to get the proper Section via the sectionIndex
var section = GetSection(sectionIndex);
if (section != null)
{
if (section.FooterView == null && !string.IsNullOrEmpty(section.FooterText))
{
// Create your FooterView here
section.FooterView = CreateFooterView(tableView, section.FooterText);
}
return section.FooterView;
}
return null;
}
我不知道 GetSection 方法是什么?我遇到错误“当前上下文中不存在名称 GetSection”。
我在 MonoTouch 网站上也找不到任何合适的文档。
感谢您的帮助。
【问题讨论】:
-
GetSection 可能是您想自己编写的方法,或者是在您找到的示例中的其他地方实现的方法。
-
我同意我必须编写 GetSection 方法,但我不知道我应该在其中写什么。其他世界它需要什么参数以及它返回什么。
-
我们在这里缺少一些上下文。你在使用 MonoTouch.Dialog 吗?你在哪里找到的例子?
-
我没有使用 MonoTouch.Dialog。我猜它与 MonoTouch.Dialog 有关,对吧?我想在没有 MonoTouch.Dialog 的情况下做到这一点......