小智 15
我使用自定义视图按钮,背景宽度为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 = @"";
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5161 次 |
| 最近记录: |