When presenting a new view with a UIBarButtonSystemItemCompose button in the navigation bar, the position is slightly off and adjusts after the view has come into view.
I think this is problem of UIBarButtonSystemItemCompose
. need some correction from apple developer team. Untill apple don't get resolve this bug. you can create your custom button and set it to rightBarButtonItem
using following code.
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button setImage:[UIImage imageNamed:@"compose.png"] forState:UIControlStateNormal];
[button addTarget:self action:@selector(buttonAction:)forControlEvents:UIControlEventTouchUpInside];
[button setFrame:CGRectMake(0, 0, 53, 31)];
UIBarButtonItem *barButton = [[UIBarButtonItem alloc] initWithCustomView:button];
self.navigationItem.rightBarButtonItem = barButton;
-(void)buttonAction:(id)sender{
NSLog(@"Click");
}
Hope this help you.