5
A
回答
4
返回按钮无法突出,突出显示的状态存在的UIReturnKeyType
不同的值:
typedef enum {
UIReturnKeyDefault,
UIReturnKeyGo,
UIReturnKeyGoogle,
UIReturnKeyJoin,
UIReturnKeyNext,
UIReturnKeyRoute,
UIReturnKeySearch,
UIReturnKeySend,
UIReturnKeyYahoo,
UIReturnKeyDone,
UIReturnKeyEmergencyCall,
} UIReturnKeyType;
蓝色的亮点在所有的这些似乎除了UIReturnKeyDefault
(这亦是一个写着“返回” )。
可以在符合UITextInputTraits
(例如UITextField
,UITextView
)[id <UITextInputTraits> returnKeyType]
任何文本输入控制设置UIReturnKeyType
。
0
我想哟想定制您的textView多一点,我找到了一个关于how to add a custom button to the keyboard的例子。这个代码日期2008年3月,我可以不上iOS5的工作,但你能得到的想法:
@synthesize window;
@synthesize viewController;
- (void)applicationDidFinishLaunching:(UIApplication *)application {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
window.backgroundColor = [UIColor blackColor];
[window addSubview:viewController.view];
[window makeKeyAndVisible];
}
- (void)keyboardWillShow:(NSNotification *)note {
//The UIWindow that contains the keyboard view
UIWindow* tempWindow;
//Because we cant get access to the UIKeyboard throught the SDK we will just use UIView.
//UIKeyboard is a subclass of UIView anyways
UIView* keyboard;
//Check each window in our application
for(int c = 0; c < [[[UIApplication sharedApplication] windows] count]; C++)
{
//Get a reference of the current window
tempWindow = [[[UIApplication sharedApplication] windows] objectAtIndex:c];
//Get a reference of the current view
for(int i = 0; i < [tempWindow.subviews count]; i++)
{
keyboard = [tempWindow.subviews objectAtIndex:i];
if([[keyboard description] hasPrefix:@"(lessThen)UIKeyboard"] == YES)
{
//Keyboard is now a UIView reference to the UIKeyboard we want. From here we can add a subview
//to th keyboard like a new button
dot = [UIButton buttonWithType:UIButtonTypeCustom];
dot.frame = CGRectMake(0, 163, 106, 53);
[dot setImage:[UIImage imageNamed:@"period.gif"] forState:UIControlStateNormal];
[dot setImage:[UIImage imageNamed:@"period2.gif"] forState:UIControlStateHighlighted];
[keyboard addSubview:dot];
[dot addTarget:self action:@selector(addDot:) forControlEvents:UIControlEventTouchUpInside];
return;
}
}
}
}
相关问题
- 1. 当按下键盘的返回按钮时,继续显示popupWindow
- 2. 显示按钮键盘
- 3. 在按钮上方显示键盘
- 4. 显示键盘上的按钮点击在ios
- 5. 如何在显示虚拟键盘时覆盖返回按钮?
- 6. 带有“Go”按钮而不是返回的iOS键盘
- 7. 显示虚拟键盘的按钮?
- 8. 数字键盘键盘不显示返回键中的iPhone
- 9. 突出显示按钮按下它
- 10. 返回键盘iOS Textfield
- 11. 显示键盘时禁用按钮
- 12. 强制通过按钮显示键盘(iOS)
- 13. IOS上的自定义键盘,带有显示图像的按钮
- 14. 使用苹果键盘上的返回按钮导航
- 15. 使键盘上的返回按钮执行操作
- 16. 返回突出显示的div的值
- 17. 突出显示Objective-C中另一个类的按钮,iOS
- 18. 键盘上'完成'按钮的退出键盘
- 19. 如何突出显示按下其他按钮的按钮
- 20. 键盘不显示(IOS)
- 21. iOS键盘显示SAVE
- 22. 突出显示与CSS单选按钮
- 23. 如何突出显示所选按钮?
- 24. 自动突出显示UITabBar按钮
- 25. 如何防止按钮突出显示
- 26. Android AndEngine按钮仍然突出显示
- 27. onLongClick后突出显示按钮不亮
- 28. Xcode - 按钮突出显示不一致
- 29. 显示ProgressDialog后返回按钮按下
- 30. 删除扩展键盘应用程序仍然显示(空) - iOS键盘地球按钮上的MyKeyboard
下一次,您发布之前,请记住,签名是不允许的,根据常见问题解答,并请检查您的帖子是否有拼写和语法错误。 – 2012-01-16 14:27:28
好吧,thanx,我不知道... – reinvdo 2012-01-17 08:50:24
官方的苹果文档显示'去'buttonhighlighted(http://developer.apple.com/library/IOs/#documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/ KeyboardManagement.html#// apple_ref/DOC/UID/TP40009542-CH5-SW3)。 这是如何完成的? – reinvdo 2012-01-20 16:00:36