Ios 我怎样才能改变巴布托石的水平位置
我可以使用setBackgroundVerticalPositionAdjustment更改自定义栏按钮项的y,但如何更改水平位置Ios 我怎样才能改变巴布托石的水平位置,ios,objective-c,uinavigationbar,uinavigationitem,Ios,Objective C,Uinavigationbar,Uinavigationitem,我可以使用setBackgroundVerticalPositionAdjustment更改自定义栏按钮项的y,但如何更改水平位置 [viewController.navigationItem.rightBarButtonItem setBackgroundVerticalPositionAdjustment:50 forBarMetrics:UIBarMetricsDefault]; 您可以使用自定义视图创建栏按钮,并在该视图中创建自己的布局。它可以是简单的UIButton,您可以在UIBu
[viewController.navigationItem.rightBarButtonItem setBackgroundVerticalPositionAdjustment:50 forBarMetrics:UIBarMetricsDefault];
您可以使用自定义视图创建栏按钮,并在该视图中创建自己的布局。它可以是简单的UIButton,您可以在UIButton中设置边设置 看 f、 e 或者,您可以在酒吧项目之后或之前在酒吧中添加一些固定空间
UIBarButtonItem *fixedSpace = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace
target:nil
action:nil];
[fixedSpace setWidth:20];
您可以使用自定义视图创建栏按钮,并在该视图中创建自己的布局。它可以是简单的UIButton,您可以在UIButton中设置边设置 看 f、 e 或者,您可以在酒吧项目之后或之前在酒吧中添加一些固定空间
UIBarButtonItem *fixedSpace = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace
target:nil
action:nil];
[fixedSpace setWidth:20];
您可以更改
rightBarButtonItem
的imageInsets
例如:
[viewController.navigationItem.rightBarButtonItem setImageInsets:UIEdgeInsetsMake(0, 0, 0, 50)];
您可以更改
rightBarButtonItem
的imageInsets
例如:
[viewController.navigationItem.rightBarButtonItem setImageInsets:UIEdgeInsetsMake(0, 0, 0, 50)];
这将缩小条形按钮项的大小。它不只是移动它。这会缩小条形按钮项的大小。它不只是移动它。