In my app I added two UIBarButtonItem with navigation bar. In iOS6 and below it looks like this
But when I run my app in iOS7 it looks like
issue is: refresh button goes down. So please help me to display refresh button equal to 'today' button. Below is the code I'm using ,
UIBarButtonItem* todayButton = [[UIBarButtonItem alloc] initWithTitle:@"Today"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(showTodayAction:)];
UIBarButtonItem *refreshButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh
target:self
action:@selector(refreshAction:)];
refreshButton.style = UIBarButtonItemStyleBordered;
UIBarButtonItem *negativeSeperator = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace
target:nil
action:nil];
negativeSeperator.width = -12;
TransparentToolbar *toolbar = [[TransparentToolbar alloc] initWithFrame:CGRectMake(0, -5, 100, TOOLBAR_HEIGHT)];
toolbar.items = [NSArray arrayWithObjects:
negativeSeperator,
refreshButton, todayButton,
negativeSeperator,
nil];
UIView *toolbarView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, TOOLBAR_HEIGHT)];
[toolbarView addSubview:toolbar];
UIBarButtonItem *toolbarItem = [[UIBarButtonItem alloc] initWithCustomView:toolbarView];
self.navigationItem.leftBarButtonItem = toolbarItem;