How to make UITextField text appear with First letter Capital on iPhone

I have a text box, and I'm only interested in the capital letter, so how to do this in iPhone UITextField.

+49
ios iphone uitextfield
Jul 25 '09 at 0:29
source share
6 answers

try this:

tf = [[UITextField alloc] init]; tf.autocapitalizationType = UITextAutocapitalizationTypeSentences; 

or set this property in the property inspector in Interface Builder

+99
Jul 25 '09 at 0:49
source share

Swift 3:

 textField.autocapitalizationType = .sentences textField.autocapitalizationType = .words textField.autocapitalizationType = .allCharacters 

Exit:

  • Suggestions : this is text input.
  • Words : this is text input.
  • All characters : THIS IS A TEXT INPUT.
+21
Sep 15 '17 at 11:02
source share

In the Attributes Inspector, located at the bottom of the "Text Box" section, there is an item called Capitalization with a drop-down menu. Here you can choose Words , Sentences or All Characters .

enter image description here

+11
May 26 '16 at 17:46
source share

The Attributes Inspector has capitalization with a drop-down menu. Here you can select "Words", "Suggestions" or "All Characters".

  • Word : if you choose a word than the first character of each word, Capital
  • Sentences : if you assign, than the first character of the first word, each sentence is β€œCapital”
  • All characters : all characters are capital
+4
Jun 03 '16 at 8:58
source share

Swift:

 tf.autocapitalizationType = .sentences 
+3
Sep 23 '16 at 9:02
source share

Select your text box, go to the interface designer (property parameter) of the storyboard, there is the Capatalization option to set it to the sentence. ltjoy !!!

+2
Aug 13 '14 at 13:11
source share



All Articles