Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xamarin UITableViewController行选择未触发_Uitableview_Xamarin_Xamarin.ios - Fatal编程技术网

Xamarin UITableViewController行选择未触发

Xamarin UITableViewController行选择未触发,uitableview,xamarin,xamarin.ios,Uitableview,Xamarin,Xamarin.ios,我在Xamarin Studio中有一个故事板,其中包括一个UITableViewController。我按照示例创建了一个从UITableViewSource继承的数据源。数据源在ViewDidLoad中分配 在UITableViewController中,我设置了数据源(而不是委托)。数据列表出现,但当我(在模拟器中)单击一行时,RowSelected事件处理程序不会启动 我已尝试自己在ViewDidLoad中连接事件处理程序: this.RowSelected+=TableView\u R

我在Xamarin Studio中有一个故事板,其中包括一个
UITableViewController
。我按照示例创建了一个从
UITableViewSource
继承的数据源。数据源在
ViewDidLoad
中分配

UITableViewController
中,我设置了数据源(而不是委托)。数据列表出现,但当我(在模拟器中)单击一行时,
RowSelected
事件处理程序不会启动

我已尝试自己在
ViewDidLoad
中连接事件处理程序:

this.RowSelected+=TableView\u RowSelected(this.TableView,this.TableView.IndexPathForSelectedRow);
这会导致编译错误,说明您无法将
RowSelected
分配给它,因为它是一个方法组


我注意到这个站点上的其他人通过删除
base.RowSelected(tableView,indexPath)解决了同样的问题,但这对我不起作用。

RowSelected
是一个方法,而不是一个属性,这就是您无法分配它的原因

如果要使用
RowSelected
,请覆盖
TableViewController
TableViewSource
中的方法

public override void RowSelected(UITableView tableView,nsindepath indepath)
{
base.RowSelected(tableView,indexPath);
}

您能显示一些代码吗?