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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 12-15-2008, 10:33 AM   #15 (permalink)
DrChuck
New Member
 
Join Date: Dec 2008
Posts: 1
Default problem with UINavigationBar

So I'm having a strange problem. I'm doing something similar to what you're doing, but I hide the UINavigationBar after a delay. However, when the user brings it back (via a click), it comes back sized for portrait mode. Any thoughts as to how to force the UINavigationController to redraw the bar correctly (note that the first time it draws after the transformation, it draws correctly).

thanks in advance, Chuck

Quote:
Originally Posted by cope784 View Post
Code:
- (void)viewWillAppear:(BOOL)animated {
	
	AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
	
	_originalTransform = [[appDelegate navController].view transform];
	_originalBounds = [[appDelegate navController].view bounds];
	_originalCenter = [[appDelegate navController].view center];
	
	CGAffineTransform landscapeTransform = CGAffineTransformMakeRotation(degreesToRadian(90));
	landscapeTransform = CGAffineTransformTranslate (landscapeTransform, +80.0, +100.0);
	
	[[appDelegate navController].view setTransform:landscapeTransform];
	
	[appDelegate navController].view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
	[appDelegate navController].view.bounds  = CGRectMake(0.0, 0.0, 480.0, 320.0);
	[appDelegate navController].view.center  = CGPointMake (240.0, 160.0);
	
	[UIApplication sharedApplication].statusBarOrientation = UIInterfaceOrientationLandscapeRight;
}

- (void) viewWillDisappear:(BOOL)animated {
	
	AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
	[[appDelegate navController].view setTransform:_originalTransform];
	[[appDelegate navController].view setBounds:_originalBounds];
	[[appDelegate navController].view setCenter:_originalCenter];
	
	[UIApplication sharedApplication].statusBarOrientation = UIInterfaceOrientationPortrait; 
}
DrChuck is offline   Reply With Quote
 

» Advertisements
» Online Users: 261
19 members and 242 guests
ADY, apatsufas, BdR, ckgni, F_Bryant, jakerocheleau, joeallenpro, ketaskin, MarkC, michelle, Music Man, NSeven, smethorst, Sunny46, themathminister, TheWebWizz, V_SC&, zbynda, ziocleto
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,876
Threads: 89,225
Posts: 380,710
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jorge599
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 08:15 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.