IPhone iOs 5, need help getting my tab bar at the top to work -
i wanted have tab bar @ top.
so created new project in xcode. added view , inside view added (scrollbar, text , view). see picture.

what wanted have tab bar @ top. in middle contents tab bar , below small copyright text. see picture.

no idea how make correctly. have tried create uitabbarcontroller on fly , assign view @ top. (top white space on picture dedicated tab bar).
here code init mainwindow.
mainwindow.h
#import <uikit/uikit.h> @class intro; @interface mainwindow : uiviewcontroller @property (strong, nonatomic) iboutlet uiscrollview *maincontentframe; @property (strong, nonatomic) iboutlet uiview *maintabbarview; @property (strong, nonatomic) uitabbarcontroller *maintabbar; @property (nonatomic, strong) intro *intro; // trying tab show in tab bar @end  mainwindow.m
#import "mainwindow.h" #import "intro.h" @interface mainwindow () @end @implementation mainwindow @synthesize maincontentframe = _maincontentframe; @synthesize maintabbarview = _maintabbarview; @synthesize maintabbar = _maintabbar; @synthesize intro = _intro; - (id)initwithnibname:(nsstring *)nibnameornil bundle:(nsbundle *)nibbundleornil { self = [super initwithnibname:nibnameornil bundle:nibbundleornil]; if (self) { // custom initialization } return self; } - (void)viewdidload { _intro = [[intro alloc] init]; nsarray *allviews = [[nsarray alloc] initwithobjects:_intro, nil]; [super viewdidload]; // additional setup after loading view. _maintabbar = [[uitabbarcontroller alloc] init]; [_maintabbar setviewcontrollers:allviews]; [_maintabbarview.window addsubview:_maintabbar.tabbarcontroller.view]; } - (void)viewdidunload { [self setmaintabbar:nil]; [self setmaincontentframe:nil]; [self setmaincontentframe:nil]; [super viewdidunload]; // release retained subviews of main view. } - (bool)shouldautorotatetointerfaceorientation:(uiinterfaceorientation)interfaceorientation { return (interfaceorientation == uiinterfaceorientationportrait); } @end  what missing work? wanted content end in scrollview tabs scrollable.
ios user interface guidelines uitabbar has @ bottom of viewcontroller. should either create own gui kind of view or use "old-fashioned" way. not try hack around uitabbar app may rejacted apple.
Comments
Post a Comment