I have a UIBarButtonItem
that I want hugging the very left of the screen. I've tried putting a fixed barbutton
with width=0 before the button and other configurations but there's always several pixels between the button and x=0.
I've also tried changing the imageInset
of the UIButton
UIButton *moreButton = [UIButton buttonWithType:UIButtonTypeCustom];
moreButton.frame = CGRectMake(0, 0, 60, 35);
[moreButton setImage:[UIImage imageNamed:@"Morebutton"] forState:UIControlStateNormal];
moreButton.imageEdgeInsets = UIEdgeInsetsMake(0, -8, 0, 8);
[moreButton addTarget:self action:@selector(pressedMoreButton:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *moreBar = [[[UIBarButtonItem alloc] initWithCustomView:moreButton] autorelease];
But tapping near the edge of the screen doesn't trigger the selector
(probably because only the image is moved but not the button itself) and increasing the size
of the button doesn't affect the gap between the button and the left side.
Thanks