Within my app, I am now using the "dark" appearance for the Keyboard for all UITextFields where I was previously using the Light Keyboard.
Above the keyboard for one of the text fields, I have a custom UIToolbar created with some buttons allowing for the user to select one of the options above the keyboard.
This seems a lot harder than it needs to be, but I'm trying to make the UIToolBar dark instead of light and no matter what I try, the toolbar is always white and I can only seem to change the colour of the buttons on the toolbar rather than the toolbar itself.
The toolbar is created in code:
UIToolbar *alertToolBar = [[UIToolbar alloc] initWithFrame:CGRectMake(0.0f, 0.0f,
self.view.window.frame.size.width, 44.0f)];
alertToolBar.backgroundColor = [UIColor blackColor];
//alertToolBar.tintColor = [UIColor colorWithRed:0.0f green:0.0f blue:0.0f alpha:1.0f];
alertToolBar.translucent = NO;
alertToolBar.items = @[ [[UIBarButtonItem alloc] initWithTitle:@" GBP"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(barButtonAddText:)],
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
target:nil
action:nil],
[[UIBarButtonItem alloc] initWithTitle:@" USD"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(barButtonAddText:)],
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
target:nil
action:nil],
[[UIBarButtonItem alloc] initWithTitle:@" EUR"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(barButtonAddText:)],
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
target:nil
action:nil],
self.itemTextField.inputAccessoryView = alertToolBar;
I've tried it with the commented out code above ( //alertToolBar.tintColor = [UIColor colorWithRed:0.0f green:0.0f blue:0.0f alpha:1.0f];
) and the bar always remains white, but it's only the "buttons" that change colour.
How can I change the WHOLE toolbar black?
Any assistance on this would be really appreciated!