2017-08-30 19 views
0

我们如何在操作表中添加表视图。我正在使用xamarin ios。我需要一张带手风琴的表格视图。我可以用手风琴做普通的表格视图。我需要动作表内的表格视图xamarin ios中的操作表中的表视图

回答

0

您应该做的第一件事就是使用UIAlertController而不是UIActionSheet,这在iOS 8中已弃用。您将拥有更容易操作警报功能。

UIAlertControllerUIViewController继承,让您根据需要添加子视图。

// Create a new UIAlertController 
var alertController = UIAlertController.Create("Alert Title", "Some text here", UIAlertControllerStyle.ActionSheet); 

// Add your custom view to the alert. Any UIView can be added. 
var yourTableView = new UITableView(); 
alertController.View.AddSubview(yourTableView) 

// Add Actions 
alertController.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Default, alert => Console.WriteLine ("Ok clicked"))); 
alertController.AddAction(UIAlertAction.Create("Cancel", UIAlertActionStyle.Cancel, alert => Console.WriteLine ("Cancel clicked"))); 

// Show the alert 
controller.PresentViewController(alertController, true, null); 

的这个动作Here's an example,虽然它在斯威夫特。