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 09-09-2010, 02:15 AM   #1 (permalink)
Registered Member
 
Join Date: Jan 2009
Posts: 21
death_au is on a distinguished road
Default Custom titleView on UINavigationController - animation issue

I'm probably doing something wrong here because this looks a bit stupid.
I'm setting up a custom titleView (in the form of a UILabel) on my UINavigationController that is the same on every page. To facilitate this, I've created a function in my app delegate to display the label correctly. I then call this function on any subviews just after I push it to the navigation stack.
Here's the code (which probably makes more sense than my explanation:
Code:
//In MyAppDelegate.m:
- (void)showTitleForNavigationController:(UINavigationController*) navController {
    UILabel *label = [[UILabel alloc] init];
    // set up label attributes
    [label sizeToFit]; //without this line my label won't show at all
    [navController.navigationBar.topItem setTitleView:label];
    [label release];
}
Code:
// In SomeViewController.m, when pushing another controller onto the stack:
UIViewController *otherViewController = //initialize other view controller;
[self.navigationController pushViewController:otherViewController animated:YES];
[(MyAppDelegate*)[[UIApplication sharedApplication] delegate] showTitleForNavigationController:otherViewController.navigationController];
My problem is that when I push the next view controller onto the stack, and the new controller slides across smoothly, for the whole duration of the animation the label sticks to the top left before finally snapping into place after the animation is finished. It looks really odd and ugly.
How can I set up the label properly so that it slides from the next view smoothly? Surely it's something simple that I'm missing...
death_au is offline   Reply With Quote
Old 08-29-2011, 12:03 PM   #2 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 1
ylva is on a distinguished road
Default

answered here
ylva is offline   Reply With Quote
Reply

Bookmarks

Tags
animation, titleview, uilabel, uinavigationbarcontroller

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: 332
10 members and 322 guests
bignoggins, carlandrews, flamingliquid, hzwegjxg, ilmman, jenniead38, linkmx, nadav@webtview.com, stanny
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,116
Posts: 402,889
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

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