Discussion Forums  >  Status Bar, Navigation Bar

Replies: 2    Views: 210

nadthevlad
Code is Art
Profile
Posts: 1025
Reg: Jun 07, 2012
Denver
21,850
03/14/13 10:39 AM (11 years ago)

use an image for refresh button

https://dl.dropbox.com/u/2452503/buzztouch_screen_shots/refreshbutton_image.jpg in BT_viewUtilities.m Replace: line 306 /* When do we show the left refresh button? BT_application flags the isHomeScreen property of the root controller of the app to allow for this. For tabbed apps, only the first tab will show the refresh button. */ if([theScreenData isHomeScreen]){ UIBarButtonItem *theRefreshButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:appDelegate action:@selector(downloadAppData)]; [theViewController.navigationItem setLeftBarButtonItem:theRefreshButtonItem]; [theRefreshButtonItem release]; } --------------------------------------------- With: /* When do we show the left refresh button? BT_application flags the isHomeScreen property of the root controller of the app to allow for this. For tabbed apps, only the first tab will show the refresh button. */ if([theScreenData isHomeScreen]){ UIButton *refreshButton = [UIButton buttonWithType:UIButtonTypeCustom]; UIImage *refreshButtonImage = [UIImage imageNamed:@"navbar-item.png"]; [refreshButton setBackgroundImage:refreshButtonImage forState:UIControlStateNormal]; [refreshButton addTarget:appDelegate action:@selector(downloadAppData) forControlEvents:UIControlEventTouchUpInside]; refreshButton.frame = CGRectMake(0, 0, 30, 30); UIBarButtonItem *theRefreshButtonItem = [[UIBarButtonItem alloc] initWithCustomView:refreshButton]; [theViewController.navigationItem setLeftBarButtonItem:theRefreshButtonItem]; [theRefreshButtonItem release]; }
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
03/14/13 09:59 PM (11 years ago)
Very cool. Are you going to create a plugin with this? Jake
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
03/14/13 10:47 PM (11 years ago)
Nice! :) Cheers! -- Smug
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.