gpt4 book ai didi

ios - UIToolbar 中工具栏项之间的分隔符

转载 作者:技术小花猫 更新时间:2023-10-29 11:00:03 25 4
gpt4 key购买 nike

如何在 UIToolbar 中的按钮之间添加分隔符?

示例图片显示在下面的链接中

enter image description here

最佳答案

我使用自定义 View 按钮实现了这一点,背景为 1 像素宽:

UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 1, 44)];
label.backgroundColor = [UIColor whiteColor];

UIBarButtonItem *divider = [[UIBarButtonItem alloc] initWithCustomView:label];
// Add button to array of toolbar items
[items addObject:divider];
// Or set items directly:
//toolbar.items = [NSArray arrayWithObject:divider];
label.text = @"";

关于ios - UIToolbar 中工具栏项之间的分隔符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9180537/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com