Ios 立根点垂直位置调整不工作

Ios 立根点垂直位置调整不工作,ios,objective-c,Ios,Objective C,我想向上移动栏按钮项,因为我更改了UINavigationBar高度 我用过: [[UIBarButtonItem appearance] setBackgroundVerticalPositionAdjustment:-20.0 forBarMetrics:UIBarMetricsDefault]; 它适用于使用自定义图像创建的UIBarButton,但不适用于包含文本的其他UIBarButton。我想用文本向上移动我的UIBarButton,声明如下: UIBarButtonItem *b

我想向上移动栏按钮项,因为我更改了UINavigationBar高度

我用过:

[[UIBarButtonItem appearance] setBackgroundVerticalPositionAdjustment:-20.0 forBarMetrics:UIBarMetricsDefault];
它适用于使用自定义图像创建的UIBarButton,但不适用于包含文本的其他UIBarButton。我想用文本向上移动我的UIBarButton,声明如下:

UIBarButtonItem *bbiDone = [[UIBarButtonItem alloc] initWithTitle:@"Готово" style:UIBarButtonItemStyleDone target:nil action:nil];
如何将其向上移动

//creat a custom view

let customView = UIView(frame: CGRect(x: 0, y: 0, width: 40, height: 40))

//creat a button

let nvButton = UIButton(frame: CGRect(x: 0, y: -40, width: 40, height: 40))

//add button to custom view's subview

customView.addSubView(nvButton)

let nvRightItem = UIBarButtonItem(customView: customView)
self.navigationItem.rightBarButtonItem = nvRightItem