我在创建像Uber 应用程序这样的自定义导航栏时遇到问题。
我将按钮背景图像设置为:
UIImage *button44 = [[UIImage imageNamed:@"navButtonAdd"]
resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
[[UIBarButtonItem appearance] setBackgroundImage:button44 forState:UIControlStateNormal
barMetrics:UIBarMetricsDefault];
但是,如果我从 xcode 界面上的按钮中删除文本,它也会消失图像,并且右侧还有一个填充,可以再次开始重复我的图像。
有谁知道我该如何解决?
这是我试图用作按钮的图像
提前致谢