How to add a separator between buttons in a UIToolbar?
Sample image is shown in the below link
I did it with a custom view button, with a 1 pixel wide background:
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 = @"";
I can think of two ways :
(a) You could make them very thin toolbar buttons with user interaction disabled.
(b) Your other choice would be to implement your own toolbar. I'd try (a) first ;)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With