hey everyone,
followed tutorial on how make tab bar 1 on instagram (http://idevrecipes.com/2010/12/16/raised-center-tab-bar-button/#comment-985)
have functioning inside app but, having trouble getting tabs go view controllers , tab bar work tab bar.
right now, tab bar appears on screen black background. (attached screenshot)
if download project , go baseviewcontroller.m see following code
which believe sets tab bar code in instagramviewcontroller.mcode:-(uiviewcontroller*) viewcontrollerwithtabtitle:(nsstring*) title image:(uiimage*)image { uiviewcontroller* viewcontroller = [[[uiviewcontroller alloc] init] autorelease]; viewcontroller.tabbaritem = [[[uitabbaritem alloc] initwithtitle:title image:image tag:0] autorelease]; return viewcontroller; }
i pretty sure need replace codecode:self.viewcontrollers = [nsarray arraywithobjects: [self viewcontrollerwithtabtitle:@"feed" image:[uiimage imagenamed:@"112-group.png"]], [self viewcontrollerwithtabtitle:@"popular" image:[uiimage imagenamed:@"29-heart.png"]], [self viewcontrollerwithtabtitle:@"share" image:nil], [self viewcontrollerwithtabtitle:@"news" image:[uiimage imagenamed:@"news.png"]], [self viewcontrollerwithtabtitle:@"@user" image:[uiimage imagenamed:@"123-id-card.png"]], nil];
am on right track? suggestions?code:self.window = [[[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]] autorelease]; // override point customization after application launch. uiviewcontroller *viewcontroller1, *viewcontroller2; if ([[uidevice currentdevice] userinterfaceidiom] == uiuserinterfaceidiomphone) { viewcontroller1 = [[[firstviewcontroller alloc] initwithnibname:@"firstviewcontroller_iphone" bundle:nil] autorelease]; viewcontroller2 = [[[secondviewcontroller alloc] initwithnibname:@"secondviewcontroller_iphone" bundle:nil] autorelease]; } self.tabbarcontroller = [[[uitabbarcontroller alloc] init] autorelease]; self.tabbarcontroller.viewcontrollers = [nsarray arraywithobjects:viewcontroller1, viewcontroller2, nil]; self.window.rootviewcontroller = self.tabbarcontroller; [self.window makekeyandvisible]; return yes;
attached files:
Forums iPhone, iPad, and iPod Touch iOS Programming
- iPhone
- Mac OS & System Software
- iPad
- Apple Watch
- Notebooks
- iTunes
- Apple ID
- iCloud
- Desktop Computers
- Apple Music
- Professional Applications
- iPod
- iWork
- Apple TV
- iLife
- Wireless

No comments:
Post a Comment