I push a ViewController
which contains not too many views, UIScrollView
which contains 10 views inside, I have a singleton ViewController
and push it again and again without releasing and allocation again the ViewController
, so all the things I do it in viewDidLoad()
, and viewWillAppear()
, but the animation is slow and choppy, what it could be?
相关问题
- UIBarButtonItem with separate portrait and landsca
- Dismiss ChildView From ParentViewController
- status bar and Navigation bar problem after dismis
- How to get a “Done” or “Back” button in an EKEvent
- Navigation Controller shows black screen
相关文章
- ios7 new pan gesture to go back in navigation stac
- How to set different navigationbar color for diffe
- UINavigationBar with buttons as title.
- How to change the title of the UINavigationBar bac
- How to open Photo app from UIViewController?
- performSegueWithIdentifier produce no segue with i
- Custom transition animation unknown delay between
- Presenting a View Controller with a button in a UI
This may be the known bug discussed in the linked an answer below. I had a similar issue and reading the answer below clarified it for me.
I've encountered the same issue today. I dug into the topic and it seems that it's related to the main runloop being asleep.
See this.
My problem is I puts mass load codes in
viewWillAppear
. My case isAnd I have a lot of rows, so pushViewController is laggy.
I had a problem where when UIViewController A did a pushViewController to push UIViewController B, the push animation would stop at about 25%, halt, and then slide B in the rest of the way.
This DID NOT happen on iOS 6, but as soon as I started using iOS 7 as the base SDK in XCode 5, this started happening.
The fix is that view controller B did not have a backgroundColor set on its root view (the root view is the one that is the value of viewController.view, that you typically set in loadView). Setting a backgroundColor in that root view's initializer fixed the problem.
I managed to fix this as follows:
As your next view coming over the previous view, if you set background to clear color, means it is transparent, the previous view is always visible for sometime which spoil animation.
You could start by using Instruments > Time Profiler and see if there is any part of your code that is taking longer than necessary.
You could also use the Instruments > Core Animation tool which can be used to flag parts of your screen that not drawing/animating efficiently.
If you're using an old iPhone or an original iPod - with complex screens, i've noticed some apps a bit choppy.
I had this problem, and it was because of old code in the pushed view controller, which caused the view to "fade in", setting the alpha to 0 on viewWillAppear and setting the alpha to 1 on viewDidAppear.
I removed the old code that did this, and the push worked fine.