我使用下面的代码创建了一个自定义栏按钮项。
UIImage* image3 = [UIImage imageNamed:@"iphone-btn-next@2x.png"];
CGRect frameimg = CGRectMake(0, 0,57,44);
UIButton *someButton = [[UIButton alloc] initWithFrame:frameimg];
[someButton setBackgroundImage:image3 forState:UIControlStateNormal];
[someButton setBackgroundImage:image3 forState:UIControlStateHighlighted];
[someButton addTarget:self action:@selector(flipView)
forControlEvents:UIControlEventTouchUpInside];
[someButton setShowsTouchWhenHighlighted:YES];
UIBarButtonItem *mailbutton =[[UIBarButtonItem alloc] initWithCustomView:someButton];
self.navigationItem.rightBarButtonItem=mailbutton;
它工作正常,但问题是当我点击按钮时,我可以看到按钮中心的白色(见截图)。有人可以向我建议摆脱它的方法吗?