Single-Stage vs Two-Stage Animation for iPhone Apps?

后端 未结 11 1715
你的背包
你的背包 2020-12-08 16:46

What are single-state and two-stage animation for rotating an iPhone window?

This is the \"error\" message I get in the Debugger Console (nothing crashes):



        
相关标签:
11条回答
  • 2020-12-08 16:55

    I've had this issue after creating a tabbarcontroller with no view controllers inside (no tabs), this warning disappeared once I attached at least one view controller to it.

    0 讨论(0)
  • 2020-12-08 16:56

    I have found the culprit in my case to be the UIImagePickerController (I also do not override any rotation animation):

    [self presentModalViewController:imagePicker animated:YES];

    Replacing imagePicker with a generic UIViewController doesn't generate any warnings.

    0 讨论(0)
  • 2020-12-08 16:58

    I changed from willAnimateFirstHalfOfRotationToInterfaceOrientation:duration: method to willAnimateRotationToInterfaceOrientation:duration: method and warning gone.

    Thanks.

    0 讨论(0)
  • 2020-12-08 16:58

    I wasn't over riding any of those two-step functions, but I was calling my own function when I received orientationChanged notifications, and I had this line of code in it. Commenting it out got rid of the warning and allowed the auto rotate to work properly. Auto rotate still worked with this line of code until iOS 4.2, then it broke completely. Spent a lot of time looking for why the built in autoRotate stopped working in 4.2. Maybe this will help someone else.

    Commented out this line to make it work:
    [[UIApplication sharedApplication] setStatusBarOrientation:currentOrientation animated:YES];

    0 讨论(0)
  • 2020-12-08 17:03

    If you're using iOS 4 and you're getting this warning, I found a way to get rid of it. In your info.plist, there is an item called "Supported interface orientations." Select which orientations your application supports and two-stage warnings will go away when bringing up the imagePicker.

    0 讨论(0)
  • 2020-12-08 17:03

    Need to add UIImagePickerController as a subview to solve this error

    [self.view addSubview:picker.view];
    [self presentModalViewController:picker animated:NO];
    
    0 讨论(0)
提交回复
热议问题