-2
我想更改鍵盤toobar
(即提交按鈕)的標題顏色,另一種方法是如何爲鍵盤工具欄添加圖像。 TIA更改鍵盤工具欄的標題顏色objective-C
UIToolbar *keyboardToolbar = [[UIToolbar alloc] init];
[keyboardToolbar sizeToFit];
keyboardToolbar.translucent=NO; //if you want it.
keyboardToolbar.barTintColor = [UIColor lightGrayColor];
_txtCommentView.inputAccessoryView = keyboardToolbar;
keyboardToolbar.items = [NSArray arrayWithObjects:
[[UIBarButtonItem alloc]initWithTitle:@"Submit" style:UIBarButtonItemStyleBordered target:self action:@selector(submitClicked:)],
nil];
如何將按鈕設置爲中心 – Abhimanyu
添加這個 UIBarButtonItem * flexibleSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil]; 檢查此鏈接http://stackoverflow.com/questions/17969260/how-to-show-button-in-center-of-toolbar – nick