- (void)viewDidLoad{
UIView *baseView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
[self.view addSubview:baseView];
// Displays UIImageView
UIImageView *myImage = [[UIImageView alloc]
initWithImage:[UIImage imageNamed:@"ka1_046.png"]];
myImage.frame = CGRectMake(0, 0, 320, 460);
[baseView addSubview:myImage];
// create the UIToolbar at the bottom of the view controller
toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 425, 320, 40)];
toolbar.barStyle = UIBarStyleBlackOpaque;
[baseView addSubview:toolbar];
How can i make Main VC’s UIToolbar which has no navigation controller and no tabbarcontroller global for all VC’s
There are several ways,
First: you could instead of presenting the new viewcontrollers, you could just add them to the
self.viewand minimize their size to fit the view controller minus the tabbarSecond: you could share the instance of the tab bar in some global class, such as app delegate, just create the tab bar in the app delegate and add a property around it, so that other VC can access it, and then at each
viewDidLoadof a new VC you would add it