objective c - In iPhone App ,How to add tab bar controller on some particular view controller Programmatically? -
in iphone app ,how add tab bar controller on particular view controller programmatically? here viewcontroller class uitableviewcontroller .
right if adding tab bar appears in table view. want display on bottom of window , and tableview should scroll separately tabbarcontroller
please , suggest
thanks
firstview *view1 = [[firstview alloc]init]; secondview *view2 = [[secondview alloc] init]; uinavigationcontroller *firstview = [[uinavigationcontroller alloc] initwithrootviewcontroller:view1]; uinavigationcontroller *secondview = [[uinavigationcontroller alloc] initwithrootviewcontroller:view2]; uitabbarcontroller* tabbar = [[uitabbarcontroller alloc] init]; [tabbar setviewcontrollers:[nsarray arraywithobjects:view1, view2, nil]]; [tabbar setdelegate:self]; uinavigationcontroller* navigationcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller:tabbar]; [self.view addsubview:navigationcontroller.view];
try this. here firstview, secondview class. if click tab, corresponding class (view) open. , have declare tabbar , navigation controller delegate.
Comments
Post a Comment