I’ve the following Custom Button on rightBarButtonItem
UIButton *button1 = [[UIButton alloc] init];
button1.frame=CGRectMake(0,0,105,30);
[button1 setBackgroundImage:[UIImage imageNamed: @"image1.png"] forState:UIControlStateNormal];
[button1 addTarget:appDelegate action:@selector(Open_Link1) forControlEvents:UIControlEventTouchUpInside];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:button1];
[button1 release];
I need to move the rightBarButtonItem up 2 px …
I’ve tried set it but doesn’t work!
button1.imageEdgeInsets = UIEdgeInsetsMake(-4, 0, 0, 0);The answer here: Can I change the position of navigationbar item?
Beware, you change insets of the button that to be assigned to the rightBarButtonItem, not the rightBarButtonItem itself.