У меня проблема с «новым» UISplitViewController на iOS 5.1.
Я активировал UISplitViewController.presentsWithGesture
, но на самом деле он не работает.
Это работает только один раз, а затем мне нужно перейти в горизонтальный вид.
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
// create a new window instance based on the screen size
window = new UIWindow (UIScreen.MainScreen.Bounds);
// load the appropriate UI, depending on whether the app is running on an iPhone or iPad
navigationController = new RootNavigationController();
detailViewController = new DetailViewController ();
detailViewController.HeaderView.Hidden=true;
navigationController.RootViewControllers[1].DetailVaiewController=detailViewController;
navigationController.DetailView=detailViewController;
splitDelegate = new SplitViewDelegate();
var prefs = NSUserDefaults.StandardUserDefaults;
String AutoUpdate= prefs.StringForKey("autoUpdate");
if(AutoUpdate=="Yes"){
navigationController.StartUpdate(true);
}
if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) {
window.RootViewController = navigationController;
}
else {
splitViewController = new SplitViewController ();
splitViewController.WeakDelegate = detailViewController;
splitViewController.ViewControllers = new UIViewController[] {
navigationController,
detailViewController
};
splitViewController.Delegate=splitDelegate;
window.RootViewController = splitViewController;
}
window.MakeKeyAndVisible ();
return true;
}
class SplitViewController:UISplitViewController{
public SplitViewController():base(){
}
}
class SplitViewDelegate:UISplitViewControllerDelegate{
public SplitViewDelegate():base(){
}
public override void WillShowViewController (UISplitViewController svc, UIViewController aViewController, UIBarButtonItem button)
{
// TODO: Implement - see: http://go-mono.com/docs/index.aspx?link=T%3aMonoTouch.Foundation.ModelAttribute
Console.WriteLine("Show");
}
public override void WillHideViewController (UISplitViewController svc, UIViewController aViewController, UIBarButtonItem barButtonItem, UIPopoverController pc)
{
// TODO: Implement - see: http://go-mono.com/docs/index.aspx?link=T%3aMonoTouch.Foundation.ModelAttribute
Console.WriteLine("Hide");
}
public override void WillPresentViewController (UISplitViewController svc, UIPopoverController pc, UIViewController aViewController)
{
Console.WriteLine("Will Present");
}
}