我有一个如下所示的工具栏:
问题是它有点困惑,因此我想给它添加一些间距。我尝试这样做:
UIBarButtonItem *spacer =
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
target:nil
action:nil];
self.toolbar_array =
[[NSMutableArray alloc] initWithObjects:self.mention,
spacer,
self.picture,
spacer,
share,
spacer,
self.message, nil];
但它仍然给我同样的东西。如何在这些 UIBarButtonItems
之间添加 10px?
最佳答案
UIBarButtonItem *fixedSpace =
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace
target:nil
action:nil];
fixedSpace.width = 10;
关于objective-c - 在 UIToolbar 之间添加间距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6798573/