Questions tagged [uitextfield]

A UITextField object is a control that displays editable text and sends an action message to a target object when the user presses the return button. You typically use this class to gather small amounts of text from the user and perform some immediate action, such as a search operation, based on that text.

A UITextField object is a control that displays editable text and sends an action message to a target object when the user presses the return button. You typically use this class to gather small amounts of text from the user and perform some immediate action, such as a search operation, based on that text.

In addition to its basic text-editing behavior, the UITextField class supports the use of overlay views to display additional information (and provide additional command targets) inside the text field boundaries. You can use custom overlay views to display features such as a bookmarks button or search icon. The UITextField class also provides a built-in button for clearing the current text. A text field object supports the use of a delegate object to handle editing-related notifications.

Resources:

8508 questions
3
votes
2 answers

UITextView font Issue in iOS 6

If any string assigned to UITextView and string contain "\n" then UITextView font changes randomly. means font size changing. This issue occurring me on only iOS 6. same code working on iOS 5.
Popat Shirsath
  • 141
  • 1
  • 1
  • 7
3
votes
1 answer

What is the interaction between Secure Text Entry and Autocorrection for a UITextField?

When using a UITextField in an iOS app, I can set secure text entry to YES, which will obscure all but the last character typed into the field. However, I can also enable autocorrection at the same time. Does anyone know what happens in that case?…
Daniel
  • 31
  • 5
3
votes
2 answers

UITextField Hide Keyboard But Reamin First Responder?

I've subclassed a UITextField to display a UIDatePicker instead of a keyboard. Entering dates is something that happens often I our app. The problem occurs when another of our custom classes that accommodates the keyboard needs to know what the…
Benjamin
  • 663
  • 8
  • 23
3
votes
2 answers

Card number first 12 digits should be secure entry and remaining 4 digits as normal

Card number first 12 digits should be secure entry and remaining 4 digits as normal for example i am entering card number - 4111 1111 1111 1111. While entering this text in textfield first 12 digits should be secure entry and last 4 digits should…
Earth
  • 43
  • 5
3
votes
1 answer

Shifting text in a UITextField when using leftView

Currently I am setting a leftView with an image and I am finding that the image is too close to the text input view (which in this case is the standard UITextField text input view). Is there a way to shift the frame of the text input view slightly…
Andrew Lauer Barinov
  • 5,694
  • 10
  • 59
  • 83
3
votes
2 answers

UIStepper swallows the touch

I'm using an UIStepper to change a value that is displayed in a UITextField, with the option of being editable entering the value in the UITextField. Everything works fine, but there is a undesired behavior: the UITextField can only be edited…
WokeR
  • 31
  • 1
3
votes
1 answer

UITextField in UITableView cell becomeFirstResponder programmatically

I have a UITextField with a tag inside a prototype cell. The UITextField is set to become first responder when the UITableView is being built and a UISwitch in the cell above is turned on. This works if the app starts from scratch or if it was…
Mike73
  • 51
  • 1
  • 6
3
votes
0 answers

UITextField in storyboard controller stops working in iOS6

We have a storyboard controller displaying a map. The screen has many nested views to display the search text, maps and other selection criteria for the map. This controller works fine for 5.0/5.1 but when I ran it in the 6.0 simulator, the search…
3
votes
1 answer

Cocoa-Touch - Make a read-only UITextField become first responder

I have a UITextField which I have set it's inputView to be of a UIPickerView so the user can choose between a few values there. However I'm having trouble making the textfield become first responder. If I set my textfield userInteractionEnabled = NO…
Peter Warbo
  • 11,136
  • 14
  • 98
  • 193
3
votes
3 answers

iOS6 and offscreen UITextView in UITableView

I have a UITableViewController that has a UITextField in each cell. When the user hits return in a field, it automatically sets the next field to be first responder and scrolls the table to show that field, like this: - (BOOL)…
Ned
  • 6,280
  • 2
  • 30
  • 34
3
votes
6 answers

Hide keyboard on touch outside of textfield

I'm trying to hide the keyboard after a touch anywhere else on the screen. The code I'm using is based on this answer here. IBOutlet UITextView *myTextView; And the method: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { …
user393964
3
votes
5 answers

UITextField clear when selected, but also restore data if nothing is input

I have a table with UITextFields, and I want to make it so that when a textfield is selected, the current info is cleared (to allow new input), but if the user decides (after selecting) that they don't want to change it, I want them to be able to…
Mirror318
  • 11,875
  • 14
  • 64
  • 106
3
votes
1 answer

UITextField show cursor even when userInteractionEnabled is set to NO

I have a UITextField and it must blink the cursor anyway, even its userInteractionEnabled property is set to NO. I don't want the UITextField to becomeFirstResponder and show the keyboard. Now you may be asking: 1. If you want to hide the keyboard,…
Natan R.
  • 5,141
  • 1
  • 31
  • 48
3
votes
1 answer

UITextView Resize Width to Fit Text

This question has been asked numerous times, but the two or three answers repeatedly given don't seem to work. The issue is: A `UITextView that contains some arbitrary text. After some action, the UITextView needs to resize both horizontally and…
Anthony Mattox
  • 7,048
  • 6
  • 43
  • 59
3
votes
1 answer

Get a range of selected text in UITextField as an NSRange is iOS 4

I've been doing it using selectedTextRange and beginningOfDocument properties from the UITextInput protocol, but as I just learned in the post below, UITextField only starts adhering to the UITextInput protocol in iOS 5, so my app is crashing in iOS…
Garrett Disco
  • 670
  • 1
  • 9
  • 27