Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 11-20-2011, 01:40 AM   #1 (permalink)
Registered Member
 
Join Date: Jan 2010
Posts: 106
somequestion is on a distinguished road
Default UINavigationController Animation in iOS5

Hello,

I've problem in View animation in iOS5. it works fine on iOS4.x version. but it dosen't work on iOS5.
here is code snippet.

A_ViewController is main controller and appDelegate is global variable
and it push bviewController when it appear.
and then it switch the bview and cview. all works fine.
but the animation(sliding effect) is not work on iOS5.
do you know why it is not working on iOS5???


Code:
A_ViewController
- (void)viewWillAppear:(BOOL)animated
{
	if(appDelegate.intGotoTabIndex == 1)
	{
		B_ViewController	*bviewController = [[B_ViewController alloc] initWithNibName:@"B_ViewController" bundle:nil];
		[self.navigationController pushViewController:bviewController animated:YES];
		bviewController release];
	}else if(appDelegate.intGotoTabIndex == 2){
		C_ViewController	*cviewController = [[C_ViewController alloc] initWithNibName:@"C_ViewController" bundle:nil];
		[self.navigationController pushViewController:bviewController animated:YES];
		cviewController release];
	
	}
}



B_ViewController

- (IBAction) Close_Clicked:(id)sender
{
	appDelegate.intGotoTabIndex = 2;
    [self.navigationController popViewControllerAnimated:NO];
}


C_ViewController

- (IBAction) Close_Clicked:(id)sender
{
	appDelegate.intGotoTabIndex = 1;
    [self.navigationController popViewControllerAnimated:NO];
}

Last edited by somequestion; 11-20-2011 at 01:47 AM.
somequestion is offline   Reply With Quote
Old 11-20-2011, 04:28 AM   #2 (permalink)
Registered Member
 
Join Date: Dec 2008
Location: UK
Posts: 1,896
harrytheshark is on a distinguished road
Default

You call popViewControllerAnimated with NO for the animation parameter, so obviously it won't animate. It's odd that it animates on iOS 4.

Also, I wouldn't try to push a new view controller in viewWillAppear, try in viewDidAppear.
harrytheshark is offline   Reply With Quote
Old 11-20-2011, 02:57 PM   #3 (permalink)
Registered Member
 
Join Date: Jan 2010
Posts: 106
somequestion is on a distinguished road
Default

Quote:
Originally Posted by harrytheshark View Post
You call popViewControllerAnimated with NO for the animation parameter, so obviously it won't animate. It's odd that it animates on iOS 4.

Also, I wouldn't try to push a new view controller in viewWillAppear, try in viewDidAppear.
I tested on viewDidAppear. animation is work but there are white screen appear. it is main controller.. i want it to switch main before main controller appear.
so i write it in viewWillAppear.

is there any way to hide main controller?
somequestion is offline   Reply With Quote
Old 11-20-2011, 02:58 PM   #4 (permalink)
Registered Member
 
Join Date: Dec 2008
Location: UK
Posts: 1,896
harrytheshark is on a distinguished road
Default

Just load the view controller you do want to show instead of the main one.
harrytheshark is offline   Reply With Quote
Old 11-20-2011, 02:59 PM   #5 (permalink)
Registered Member
 
Join Date: Jan 2010
Posts: 106
somequestion is on a distinguished road
Default

maybe i have to change the code....this

[self.navigationController pushViewControllerbjView animated:YES];

to

[self.navigationController pushViewControllerbjView animated:NO];


and then write some additional code for animation.
how can do that. I need only sliding uiview left to right.
thank you
somequestion is offline   Reply With Quote
Old 11-20-2011, 03:08 PM   #6 (permalink)
Registered Member
 
Join Date: Jan 2010
Posts: 106
somequestion is on a distinguished road
Default

Quote:
Originally Posted by harrytheshark View Post
Just load the view controller you do want to show instead of the main one.
this logic is not like that.

main controller is only push controllers to navigationController.
and there are lots of subController...
Acontroller
Bcontroller
C
D
E..
...

when each controller is close it will coall popViewControllerAnimated:NO
and main controller will push another controller.
...
somequestion is offline   Reply With Quote
Old 11-23-2011, 03:30 AM   #7 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 3
leviswu is on a distinguished road
Default very helpful

Thanks shares, very helpful
leviswu is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 381
18 members and 363 guests
7twenty7, Alex-alex, Apptronics RBC, baja_yu, chiataytuday, Clouds, dedeys78, dre, Duncan C, e2applets, ipodphone, jeroenkeij, leostc, matador1978, mbadegree, QuantumDoja, Retouchable, usernametaken
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,125
Posts: 402,910
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:30 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0