我想自定义我的 UIBarButtonItem 的外观。这是我目前正在使用的代码:
UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(267, 6, 48, 30)];
[editButton setCustomView:button]; // editButton is the UIBarButtonItem
不幸的是,UIButton 没有被绘制,即它是 100% 透明的。我知道按钮在那里,因为当我在代码中添加一行时,如下所示:
UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(267, 6, 48, 30)];
[editButton setCustomView:button]; // editButton is the UIBarButtonItem
UIRectFill(button.frame);
我看到一个黑色方块出现在按钮应该出现的位置。
如何让我的 UIButton 被绘制?我已经看了很多地方,但似乎没有任何效果......