I'm working with iOS SDK 5b5, MonoTouch 4.0.3, Mono 2.10.3_5 and MonoDevelop
2.6b3. I have a UITabBarController that is hosting a UIImagePickerController
with SourceType set to Camera. The first time I switch to the the
UIImagePickerController everything works fine. When I switch to another tab
and then come back I no longer get a live video preview (though I can still
capture an image). The same approach worked fine on iOS 4.3.

Is there a better way to use UITabBarController with
UIImagePickerController?

        public partial class AppDelegate : UIApplicationDelegate
        {
                public UITabBarController tabBarController;
                public UITableViewController tableViewController;
                public UIImagePickerController imagePickerController;

                // This method is invoked when the application has loaded its 
UI and its
ready to run
                public override bool FinishedLaunching (UIApplication app, 
NSDictionary
options)
                {
                        window.MakeKeyAndVisible ();
                        
                        tableViewController = new UITableViewController ();
                        
                        imagePickerController = new UIImagePickerController ();
                        if (UIImagePickerController.IsSourceTypeAvailable
(UIImagePickerControllerSourceType.Camera)) {
                                imagePickerController.SourceType =
UIImagePickerControllerSourceType.Camera;
                        }
                        
                        tableViewController.TabBarItem = new UITabBarItem () { 
Title = "Table" };

                        imagePickerController.TabBarItem = new UITabBarItem () 
{ Title = "Camera"
};
                        
                        tabBarController = new UITabBarController ();
                        tabBarController.SetViewControllers (new 
UIViewController[]
                                                { tableViewController, 
imagePickerController }, false);
                        window.AddSubview (tabBarController.View);
        
                        return true;
                }
        }


--
View this message in context: 
http://monotouch.2284126.n4.nabble.com/No-preview-when-switching-to-UIImagePickerController-via-UITabBarController-on-iOS-5-tp3732760p3732760.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to