在 UIToolbar 之间添加间距
我有一个如下所示的工具栏:
问题是它有点混乱,因此我想为其添加一些间距。我尝试这样做:
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?
I have a toolbar that looks like the following:
The issue is that it is kind of cluttered and therefore I would like to add some spacing to it. I tried doing:
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];
But it still gives me the same thing. How can I add a 10px between these UIBarButtonItems
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要在您要查找的项目之间添加空格。
这可以通过..
希望这对你有帮助。
You need to add space in between the items what u r looking for.
this can be done by..
hope this will help u.
我使用此代码生成 UIBarButtonItems,它是一些头文件,如果需要,我会#import。
I use this code to generate UIBarButtonItems, it's some header file which I #import if needed.