アプリ内で、以前はライト キーボードを使用していたすべての UITextField のキーボードに「ダーク」な外観を使用しています。
テキスト フィールドの 1 つのキーボードの上に、ユーザーがキーボードの上のオプションの 1 つを選択できるようにするいくつかのボタンで作成されたカスタム UIToolbar があります。
これは必要以上に難しいようですが、UIToolBar を明るくするのではなく暗くしようとしています。何を試しても、ツールバーは常に白く、ボタンの色を変更することしかできません。ツールバー自体ではなく、ツールバー。
ツールバーはコードで作成されます。
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;
上記のコメントアウトされたコード ( ) で試してみましたが//alertToolBar.tintColor = [UIColor colorWithRed:0.0f green:0.0f blue:0.0f alpha:1.0f];
、バーは常に白いままですが、色が変わるのは「ボタン」だけです。
ツールバー全体を黒く変更するにはどうすればよいですか?
これに関するご支援をいただければ幸いです。