IOS 开发 Creating Custom Keyboards ( 自定义键盘) 1. 新建 View-based-app 起名: Feelings 中添加一个 UITextView 3. 添加一个新的 XIB 起名: MoodKeyboard IB 中打开 MoodKeyboard, 从 library 中拖一个 toolbar 到 View 中,将 View 的高度设为 toolbar 的高度(44px)! 然后再拖一个 UIButton 到 toolbar 中, 如图 5. 设置 MoodKeyboard-view-Toolbar 的 Autosizing, 如图 6. 将 moodKeyboard 的 File's Owner 的 Class Identify 选为 FeelingsViewController 7. 到些,FeelingsViewController 控制都两个 XIB, 一个是 , 另一个是 中代码如下: #import <UIKit/> ***@interface FeelingsViewController : UIViewController { } ***@property ( nonatomic , retain ) IBOutlet UIView *moodKeyboard; ***@property ( nonatomic , retain ) IBOutlet UITextView *textView; -( IBAction )btnClicked:( id )sender; ***@end 中添加代码如下***@synthesize textView,moodKeyboard; -( IBAction )btnClicked:( id )sender{ [ textView setText : @"AAA" ]; [ self . textView resignFirstResponder ]; }-( vo
IOS开发自定义键盘 来自淘豆网m.daumloan.com转载请标明出处.