我正在从一个条形按钮项中展示一个弹出窗口,但是弹出窗口的箭头在水平方向上并不居中于该项下方:
我想将其向左移动几个像素。
这并不会在所有UIBarButtonItem实例上发生,仅在我使用自定义图像创建时才会发生。因此,例如,最右侧的按钮项具有完美居中的箭头,并且它是使用系统项实例化的:
![presenting popover from bar button item](https://istack.dev59.com/IRdzO.webp)
这并不会在所有UIBarButtonItem实例上发生,仅在我使用自定义图像创建时才会发生。因此,例如,最右侧的按钮项具有完美居中的箭头,并且它是使用系统项实例化的:
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(shareButtonWasPressed:)]
但是,如果我使用自定义图像,
[[UIBarButtonItem alloc] initWithImage:slideshowImage style:UIBarButtonItemStylePlain target:self action:@selector(slideshowButtonWasPressed:)]
...它偏离中心。我尝试调整按钮项的imageInsets
,但它会拉伸图像。有什么建议吗?