2012-01-16 27 views
5

पर 'रिटर्न' बटन को हाइलाइट करें, मैं मानक आईओएस कीबोर्ड पर रिटर्न बटन को हाइलाइट करने का कोई तरीका ढूंढने का प्रयास कर रहा हूं, लेकिन मुझे कोई दस्तावेज नहीं मिला है।आईओएस कीबोर्ड

क्या कोई जानता है कि यह कैसे करें?

उत्तर के लिए बहुत बहुत धन्यवाद।

+0

अगली बार, पोस्ट करने से पहले, याद रखें कि हस्ताक्षर की अनुमति नहीं है, सवाल जवाब के अनुसार , और कृपया वर्तनी और व्याकरण संबंधी त्रुटियों के लिए अपनी पोस्ट जांचें। –

+0

ठीक है, thanx, मुझे नहीं पता था ... – reinvdo

+0

आधिकारिक सेब दस्तावेज 'गो' बटन हाइलाइट किया गया है (http://developer.apple.com/library/IOs/#documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/ KeyboardManagement.html # // apple_ref/doc/यूआईडी/TP40009542-CH5-SW3)। यह कैसे किया जाता है? – reinvdo

उत्तर

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

मैं मामला यो अपने पाठ को अनुकूलित करना चाहता हूं थोड़ा और देखें, मुझे how to add a custom button to the keyboard के बारे में एक उदाहरण मिला। यही कारण है कि कोड मार्च, 2008 को दिनांकित है और मैं इसे 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; 
      } 
     } 
    } 
} 
संबंधित मुद्दे