C# 如何从UITableView Xamarin.ios c中选择行的文本

C# 如何从UITableView Xamarin.ios c中选择行的文本,c#,ios,xamarin,xamarin.ios,C#,Ios,Xamarin,Xamarin.ios,我想从表中的一行中选择文本,我已经做了一些搜索,但似乎在Xamarin.ios中找不到一个示例。我想我想要类似的东西 -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *selectedCell = [tableView cellForRowAtIndexPath:indexPath]; NSString

我想从表中的一行中选择文本,我已经做了一些搜索,但似乎在Xamarin.ios中找不到一个示例。我想我想要类似的东西

    -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *selectedCell = [tableView cellForRowAtIndexPath:indexPath];
    NSString *cellText = selectedCell.textLabel.text;
}
但是在Xamarin.ios而不是objective c中,任何帮助都将不胜感激,谢谢

public override void RowSelected (UITableView tableView, NSIndexPath indexPath)
{
     new UIAlertView("Row Selected", tableItems[indexPath.Row], null, "OK", null).Show();
     tableView.DeselectRow (indexPath, true); // iOS convention is to remove the highlight
}
您只需要行索引indexath.row,就可以从填充UITableView的数组中获取文本

从Xamarin网站了解如何