C# 从所选行返回值
我当前的TableView返回五个项目。 商品:苹果、梨、香蕉、橘子、芒果 我想知道如何获取所选行的值。例如,如果我单击Apple,值将为“Apple”C# 从所选行返回值,c#,xamarin,C#,Xamarin,我当前的TableView返回五个项目。 商品:苹果、梨、香蕉、橘子、芒果 我想知道如何获取所选行的值。例如,如果我单击Apple,值将为“Apple” 如果有下划线,我想显示获取值的方法。类似于GetRowValue(indexPath)。任何帮助都将不胜感激。假设您的底层数据源是 List<Fruit> data; List<Fruit> data; public override void RowSelected(UITableView tableView, N
如果有下划线,我想显示获取值的方法。类似于GetRowValue(indexPath)。任何帮助都将不胜感激。假设您的底层数据源是
List<Fruit> data;
List<Fruit> data;
public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
{
var item = data[indexPath.Row];
HelloViewController helloView = new HelloViewController(item);
AppDelegate appDelegate = UIApplication.SharedApplication.Delegate as AppDelegate;
appDelegate.RootNavigationController.PushViewController(helloView, true);
}