Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const CGRect imageFrame = CGRectMake(0, 0, 44., 44.);
- UIButton *button = [[UIButton alloc] initWithFrame:imageFrame];
- [button setImage:[UIImage imageNamed:@"backButton"] forState:UIControlStateNormal];
- [button setContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft];
- button.contentEdgeInsets = UIEdgeInsetsMake(0, -6., 0, 0); // здесь получается сдвинуть влево картинку на кнопке, но не саму кнопку
- // [button addTarget:self action:someSelector forControlEvents:UIControlEventTouchUpInside];
- UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithCustomView:button];
- [self.navigationItem setLeftBarButtonItem:backButton];
Add Comment
Please, Sign In to add comment