简体   繁体   中英

Best way to implement UIToolbar with UITextField above keyboard

What is the best way to have a UIToolbar with a UITextField appear above the keyboard ?

In particular, I'm looking for a way to implement this in iOS 6.

The basic functionality I am trying to achieve is similar to iOS SMS app except the keyboard would appear by default.

Thanks.

Either adding a toolbar to your storyboard and add an outlet to it, or add the toolbar to a xib file then use InputAccessoryView of text field you want to add the toolbar to it eg

[[NSBundle mainBundle] loadNibNamed:@"KeyboardToolbar" owner:self options:nil];
[textField setInputAccessoryView:keyboardToolbar];

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM