Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sujithkrishnan

macrumors 6502
Original poster
May 9, 2008
265
0
Bangalore
In my viewDidAppear of my viewController,....

i am giving....

[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:[self view] cache:YES];

within begin/commit block of animation...

Its not working.... But it is wrking for "UIViewAnimationTransitionFlip" kind...
 

Luke Redpath

macrumors 6502a
Nov 9, 2007
733
6
Colchester, UK
Can you define "not working"? There is a bug in the iPhone simulator that means curl transitions only display as a simple fade.

On a related note, does anybody else find it annoying that the SDK doesn't provide a standard slide in/out transition (unless you are using a navigation controller which does it for you)?
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
I had noticed that what was named a Curl animation seemed to be a fade. I like the fade. So does the curl actually curl on the phone? Is there a way that I can implement a simple fade animation?

I'm using UIWebView as an interface. I trap the link-presses and reload a dynamically generated page. UIWebView hesitates when you press a link so I have a simple animation that makes this transition from one web page to the next smooth using the curl animation, which you now say is a bug. I've done all my development on the simulator so how does this all look on the phone?
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
I think Maps isn't available on the Simulator. Guess I gotta get the iPod Touch I've looking at. Is an 8G iPod Touch sufficient for development work?
 

Taum

macrumors member
Jul 28, 2008
56
0
I had noticed that what was named a Curl animation seemed to be a fade. I like the fade. So does the curl actually curl on the phone? Is there a way that I can implement a simple fade animation?

Yes, the Curl animation seems to fade on the simulator but is actually a page curl in the iPhone/iPod touch.
You can create a fade animation fairly simply by animating the alpha property of a view.
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
OK, I got a wild hair today and decided to figure out how to do a real fade animation. I tried the alpha animation but fading to white and back just doesn't look very good as a transition. In the end it's only a few lines of code. This looks pretty near identical to the fade/curl transition that I had before.

This code runs in my view controller for a webview:

Code:
	[CATransaction begin];
	CATransition *animation = [CATransition animation];
	animation.type = kCATransitionFade;
	animation.duration = 0.15;

	[mWebView loadData:data MIMEType:@"text/html" textEncodingName:@"utf-8" baseURL:nil];

	// Commit the animation
	[[self.view layer] addAnimation:animation forKey:@"myanimationkey"];
	[CATransaction commit];
 

RobertBlackburn

macrumors newbie
Oct 7, 2008
12
0
Hi i tried the code you supplied and got it working in one of my apps but i am having a slight problem with it.

When the app starts and the device is portrait the fade works fine and smooth.

If i rotate the device the app rotates as it should, i then put the device back to portrait, rotates as it should. Then when i use the fade transition again it is slower and noticeably jerky and stays this way until the app is reset :confused:

have you had any experience of this or know what would be causing it to do this?

i am just lost for ideas now on how to fix it
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
I haven't seen any problem with the fade transition slowing down. I just did try to rotate my app from portrait to landscape and back. I let the app do a bunch of transitions before and after and didn't see any problems.

You might want to check with the performance tools to see what code is being called when it gets slow. Is it possible that your app is using using a lot of memory and that's what's causing the slowdown? One other thought, views get resized and repositioned after rotations. Maybe some views are in odd positions or are not on integral coordinate boundaries and that slows things down. (just a guess) You could try hiding some views or otherwise removing them to see if any particular view is causing the slowdown.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.