【发布时间】:2014-04-08 07:45:39
【问题描述】:
我花了几个小时试图解决这个问题。我最后的选择是只创建空白标签来创造空间,但我觉得他们是一种更清洁的方式。
基本上我有三个按钮,我们试图在它们之间创建固定空间以保持整洁。每个按钮都是以编程方式添加的。
我找到了这段代码:
UIBarButtonItem *fixedItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
fixedItem.width = 20.0f; // or whatever you want
(Source)
但是如何将这段代码分配给某个按钮呢?
【问题讨论】:
标签: ios uinavigationbar uibarbuttonitem