How to position a UIToolbar at the top of the screen?
Posted
by Mr_Nizzle
on Stack Overflow
See other posts from Stack Overflow
or by Mr_Nizzle
Published on 2010-06-09T15:31:40Z
Indexed on
2010/06/09
16:02 UTC
Read the original article
Hit count: 280
I've figured out how to hide the navigation bar and then show the toolbar it has built-in but the toolbar appears at the bottom os the screen how can i position the toolbar on the top of the scren?
here's some of my code
UIBarButtonItem *yesterday = [[UIBarButtonItem alloc]initWithTitle:@"Yesterday"
style:UIBarButtonItemStyleBordered target:self action:@selector(yesterday:)];
UIBarButtonItem *today = [[UIBarButtonItem alloc]initWithTitle:@"Today"
style:UIBarButtonItemStyleDone target:self action:@selector(today:)];
UIBarButtonItem *tomorrow = [[UIBarButtonItem alloc]initWithTitle:@"Tomorrow"
style:UIBarButtonItemStyleBordered target:self action:@selector(tomorrow:)];
UIBarButtonItem *month = [[UIBarButtonItem alloc]initWithTitle:@"Month"
style:UIBarButtonItemStyleBordered target:self action:@selector(month:)];
NSArray *items = [NSArray arrayWithObjects:yesterday,today,tomorrow,month, nil];
[yesterday release];
[today release];
[tomorrow release];
[month release];
[self setToolbarItems:items];
[[self navigationController] setNavigationBarHidden:YES animated:NO];
[[self navigationController] setToolbarHidden:NO animated:YES];
Thanks.
© Stack Overflow or respective owner