strange animation of iphone UI - iphone

I am making my UI from nib files and have added a few animations for UIKit.But as i continue to use my application UI starts to load while animating.Even Navigation bar show with an animation.It seems some kind of memory issue or by some reason uikit is taking time to draw its controls.Would appreciate any kind of help

Here is what i did wrong.I animated a few view using UIView animations but missed to call commitAnimation.I think this is what end up the routine.Thanks for the helps however

You should post some code, but it sounds like you're doing view manipulations inside of a UIView animation block that you shouldn't be doing.

Related

Forcing a UIImageView to Remain in Front of an Active Animation

Language: Swift, IDE: Xcode for iOS development, Single View Application > View Controller...
I have 2 UIImage Views with identical images that I'm scroll-animating from left to right across the view in order to create a 'slowly-moving background' of sorts. I'd like to place other UI elements (Labels, other images, etc.) in the foreground of this repeating background animation, but find when I run the simulator the foreground image isn't seen...
Question: Is it possible to force other UI elements to stay in front of a repeating animation programmatically?
I'm not at my Mac so I can't share my code at the moment, but if you know a straight answer to the question and/or which method could best achieve this, I'm all ears!!
Thanks in advance! :)
This depends on the z-ordering of the views. Assuming you are adding all of your views then starting the animation call bringSubViewToFront on the view you are animating right before you start animating it. If you are laying things out in interface builder the Z order is based on top = farthest and bottom = closest. If you are adding view programmatically the newest view is always added in front. You can change this with insertSubview:at: and the related methods. Take a look at the documentation for UIView.
If you want z-index use:
YourImageViewName.layer.zPosition = 1
Also you could play with bringToFront method on the parent view:
self.view.bringSubviewToFront(YourImageViewName)
Hope this fix your problem.

UIScrollView stopping my UIGesture from doing view transition

So I am working on this project here, to test some things that I am interested about, such as view transitions using UIGestures.
I am currently testing how view transitions behave when they have things like UIWebViews and UIScrollViews in them. What I have found out currently is that if you have a UIScrollView bigger than the view frame then the transition (using gestures) is blocked if you are using a UIGesture to change the view. (Such as swipe left or right)
I was wondering if there is a way around this or a solution that I don't know about..
Try using
gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:
return no for it and see if that works.

Making view transitions fast - do you use this hack?

I have an iPhone app that displays a modal view controller. The modal view controller shows two instances of a custom subclass of UITextView called RoundedTextView, an MKMapView, and a UIToolbar. I construct the viewController only once, and reset its data and present it each time the user summons it.
When showing this view controller with presentModalViewController, I noticed that the animation to show the view was choppy on the 3G. So, to speed it up, I set the alpha of the MKMapView and the two RoundedTextView objects to 0 on viewWillDisappear and back to 1 on viewDidAppear. This made it nice and fast. I also presume that I could remove the views from the superview to speed it up as well.
Does anyone else jump through these kind of hoops on the iPhone. Is there something else I should be doing to avoid this hack?
It's not a hack to simplify drawing during animation in order to make the animation more smooth. It is indeed a very valid technique.
You may be able to achieve similar performance improvements by setting all UI elements to Opaque, a technique also used to fix table view cell performance issues. You just have to make sure background colors match.
The main problem I had was I subclassed UIButton to make gradient buttons and I had the boundary mask enabled. This made the performance terrible. I removed that option and made my buttons square and it's blazin now.

Background of UINavigationController view turns white

My iPhone application uses the camera to take pictures, which I suspect is somewhat memory-intensive. The app uses a custom background image for the view of its UINavigationController, and after taking a few pictures, the background goes all white. Any ideas on what I can do to stop this?
Check to see if -didReceiveMemoryWarning is being called in any of your viewControllers. If it's a low memory problem, that's probably the culprit.
Expanding on Ben Gottlieb's post, is it really necessary for you to have the custom background image? That by itself is a big memory waste; I shutter (eh, camera pun) to think of combining the two without releasing the picture before redisplaying the tableView.
Unfortunately, the project was very specific about having a background image, so I had to retain it despite the memory waste.
My work-around was to unload the background once you've entered the photos-view, and then reload it before you leave. Not the most beautiful solution, but it works really well.
I had exactly the same issue, and resolved it by subclassing UINavigationController.
Then in the viewDidLoad method I simply create my background (ImageView) and add it to the view.
If your UINavigationController is created from a nib, just give it your custom class name in IB. I had to do that as I also have a custom navigationbar, which you can only set in IB.

Refresh UIView with paging animation

I have a UIView that has controls built based off a date. I want to flick to change the date and refresh the UIView with an animation like the paging animation. Is that possible? I do not want to create multiple copies of my UIView because it is already close to exceeding memory. 2 copies of my UIView would definitely crash the phone. Does anybody have any suggestions? Please let me know.
Although I haven't tested it, you should be able to use the same instance of the UIView that would generate a 'flip' or whatever animation using the same UIView as the underlying view and the overlying view.
I've stumbled into this accidentally, trying to get some animations working.