【发布时间】:2012-05-22 14:44:29
【问题描述】:
我正在使用带有静态内容的故事板和表格视图。在内部,UITableViewController 似乎隐含地成为了UITableView 的来源。
如果我现在想影响静态内容,我将不得不覆盖表源的方法。在 ObjectiveC 中我可以放置
-(NSString*)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
if (section == 0)
return @"HELLO!";
else {
return [super tableView:tableView titleForHeaderInSection:section];
}
}
在我的控制器中,该方法将被覆盖。但在 MonoTouch 中,这不起作用。 请注意,我不想创建委托或数据源的新实例。对于静态单元,控制器是源/代表。在 ObjectiveC 中,这是通过让控制器实现相应的协议来完成的。
这是我提出的与该主题相关的问题,但现在我无法将解决方案转换为 MonoTouch:
How to override tableView:titleForHeaderInSection: to adjust section headers of static UITableViews?
【问题讨论】:
标签: c# xamarin.ios uikit