C# 从TableView打开视图
我对使用Monotouch很不熟悉。我在查找有关如何从C# 从TableView打开视图,c#,uitableview,xamarin.ios,C#,Uitableview,Xamarin.ios,我对使用Monotouch很不熟悉。我在查找有关如何从public override void RowSelected中打开新视图的教程时遇到问题。我可以打电话给: SecondView second = new SecondView(string sometext) 还是做得不同 这取决于您是否希望以模式显示视图 在某些地方,您将需要对viewcontroller的引用(我们现在假设它是m_Controller)。一旦具备了该功能,对于模态视图,您可以调用: m_Controller.Pre
public override void RowSelected
中打开新视图的教程时遇到问题。我可以打电话给:
SecondView second = new SecondView(string sometext)
还是做得不同 这取决于您是否希望以模式显示视图 在某些地方,您将需要对viewcontroller的引用(我们现在假设它是m_Controller)。一旦具备了该功能,对于模态视图,您可以调用:
m_Controller.PresentModalViewController(new SecondView(someText), true);
对于非模态:
m_Controller.PushViewController(new SecondView(someText), true);
在objC中,您可以使用UINavigationController pushViewController(您的视图将位于UIViewController中)或presentModalViewController。我想monotouch中也有类似的情况——他们的课程非常接近。