Question: Here is the snapshot:
![enter image description here](https://i.stack.imgur.com/qmXkR.png)

And the code is here:

```
UIButton *leftButton = [UIButton buttonWithType:UIButtonTypeCustom];
leftButton.frame = CGRectMake(0.0f, 0.0f, 46.0f, 32.0f);
[leftButton setBackgroundImage:[UIImage imageNamed:@"navi_register_up.png"] forState:UIControlStateNormal];
[leftButton addTarget:self action:@selector(doRegister) forControlEvents:UIControlEventTouchUpInside];

UIBarButtonItem *leftBarItem = [[UIBarButtonItem alloc] initWithCustomView:leftButton];
self.navigationItem.leftBarButtonItem = leftBarItem;
[leftBarItem release];

```

Is there any way to move the button up some px?
Thank you:)

Answer: 
Here's a Swift 3 version of the most voted answer:

```
 let soundButton = UIBarButtonItem(image:image , style: UIBarButtonItemStyle.plain, target: self, action: #selector(self.soundPressed))

        let negativeSpacer = UIBarButtonItem(barButtonSystemItem: .fixedSpace, target: nil, action: nil)
        negativeSpacer.width = -5

        self.navigationItem.rightBarButtonItems = [negativeSpacer,soundButton]

```
You can use this code,I think this will be helpful to you.
UIButton \*button = [UIButton buttonWithType:UIButtonTypeCustom];
 button.frame = CGRectMake(0,0,50,32);
 [button setBackgroundImage:[UIImage imageNamed:@"btn\_back.png"] forState:UIControlStateNormal];

```
[button addTarget:self action:@selector(BackBtnClicked) forControlEvents:UIControlEventTouchUpInside];
UIView *backButtonView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 50, 32)];
backButtonView.bounds = CGRectOffset(backButtonView.bounds, -1, -4);
[backButtonView addSubview:button];

UIBarButtonItem *barButtonItem = [[UIBarButtonItem alloc] initWithCustomView:backButtonView];
//barButtonItem.imageInsets = UIEdgeInsetsMake(-6, 20, 30, 0);

[self.navigationItem setLeftBarButtonItem:barButtonItem];

```