I have recently put some time into learning how to add a toolbar to the navcontroller using programming instead of IB.
I added a button to show an about view, which works well, but can't figure out how to add a label on the toolbar. I started with the example code Apple gives, just to see it in action:
To those in the know, this obviously adds the label to the list in the nav controller, not the toolbar. This means the label is underneath the toolbar. I can see it must have to be added to the toolbar controller, a level up, but can't see how or where to put it.
Any pointers?
I added a button to show an about view, which works well, but can't figure out how to add a label on the toolbar. I started with the example code Apple gives, just to see it in action:
CGRect labelFrame = CGRectMake(150.0, 340.0, 150.0, 30.0);
UILabel *label = [[UILabel alloc] initWithFrame:labelFrame];
[label setFont:[UIFont systemFontOfSize:14]];
label.textAlignment = UITextAlignmentLeft;
[label setText"App Name"];
label.textColor = [UIColor redColor];
label.backgroundColor = [UIColor clearColor];
[self.view addSubview:label];
To those in the know, this obviously adds the label to the list in the nav controller, not the toolbar. This means the label is underneath the toolbar. I can see it must have to be added to the toolbar controller, a level up, but can't see how or where to put it.
Any pointers?