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