2011-10-29 15 views
11

क्या टेक्स्ट इनपुट के साथ नए UIAlertView पर ऑटो-कैपिटलिशन विकल्प सेट करने का कोई तरीका है?
मैं इस बड़े अक्षर से शुरू करना चाहते हैं:UIAlertView की UITextField पर ऑटोकापिटाइजेशन कैसे सेट करें?

UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Add Name" message:@"Enter name for routine" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Add", nil]; 
    [alert setAlertViewStyle:UIAlertViewStylePlainTextInput]; 
    [alert show]; 

उत्तर

40
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Add Name" message:@"Enter name for routine" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Add", nil]; 
[alert setAlertViewStyle:UIAlertViewStylePlainTextInput]; 
[alert textFieldAtIndex:0].autocapitalizationType = UITextAutocapitalizationTypeSentences; 
[alert show]; 
2

वहाँ अपनी प्राथमिकताओं के अनुसार तीन प्रकार हैं।

पहले प्रत्येक शब्द के पहले अक्षर को बड़ा करना है:

[alert textFieldAtIndex:0].autocapitalizationType = UITextAutocapitalizationTypeWords; 

दूसरे सभी शब्दों

[alert textFieldAtIndex:0].autocapitalizationType = UITextAutocapitalizationTypeAllCharacters; 

तीसरे एक वाक्य में हर शब्द फायदा उठाने में है फायदा उठाने में है

[alert textFieldAtIndex:0].autocapitalizationType = UITextAutocapitalizationTypeSentences;