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
0 answers

Left inset padding on UISearchBar text field (iOS7) cause text to cover clear button

I have a UISearchBar with a searchTextPositionAdjustment which is causing the text to overlay and display on top of the (x) clear button that appears on the right side of the SearchBar. I have tried quite a few suggestions from other answers…
Herwr
  • 31
  • 3
3
votes
10 answers

Limit UITextField to one decimal point Swift

How can I limit a UITextField to one decimal point with Swift? The text field is for entering a price, so I cannot allow more than one decimal point. If I was using Objective-C, I would have used this code: -(BOOL)textField:(UITextField *)textField…
Shan
  • 3,057
  • 4
  • 21
  • 33
3
votes
1 answer

How to place UILabel next to last character of UITextField?

I am trying to achieve the same effect as Facebook's new status field: place something next to the last character which cannot be modified or selected by the user (for example, a tag: "with Joh Doe"). What's the best way of achieving…
nzapponi
  • 476
  • 1
  • 3
  • 14
3
votes
3 answers

resignFirstResponder not getting called inside textFieldShouldClear

I am trying to implement search bar in one of my page. I am not using regular search bar due to its design. What I have is as below. UIImageView above UIView (textfield background) UITextField above UIImageView (textfield) I am using delegates for…
Fahim Parkar
  • 30,974
  • 45
  • 160
  • 276
3
votes
2 answers

Unable to use backspace key to delete a character from a textfield in iOS

I am implementing the following delegate method for UITextField: - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { NSString *integerPart = [textField.text…
syedfa
  • 2,801
  • 1
  • 41
  • 74
3
votes
1 answer

allow only to enter english characters in iPhone UITextField

I want to allow user to enter only english alphabets and characters. How can i prevent user from entering other characters than english.
Jim
  • 4,639
  • 5
  • 27
  • 31
3
votes
2 answers

How to display keyboard in iOS8

Im trying to convert my iOS7 project to iOS8 When I built the app in iPhone 5s simulator for iOS8.0, I found the keyboard would no longer appear automatically when clicking a UITextField or UITextView... Is there any one can tell me how to solve…
Wilson L
  • 138
  • 7
3
votes
1 answer

becomeFirstResponder very slow

I have the following viewDidLoad method: - (void)viewDidLoad { NSLog(@"didLoad"); if (self.loginField.text.length > 0) [self.passwordField becomeFirstResponder]; else [self.loginField becomeFirstResponder]; } I also add log times in…
Szu
  • 2,254
  • 1
  • 21
  • 37
3
votes
1 answer

UITextField text vertically shifts after Dynamic Type Resize

I am using Dynamic Type in my app. If I start it with Dynamic Type in the smallest text size mode, and click on the UITextField to edit, everything is fine. It opens the keyboard, and the text stays still. Then when I go out, change the text size…
NickH
  • 683
  • 1
  • 5
  • 24
3
votes
3 answers

How do I set an Integer in a UITextfield using Core Data?

I can set text in my managed object like this... [editedObject setValue:textField.text forKey:editedFieldKey]; but I can't set this... [editedObject setValue:numberField.text forKey:editedFieldKey]; In the XCode Template I can set this straight…
Stef
  • 77
  • 2
  • 11
3
votes
2 answers

Font problems on retina display

I'm kind of newbie in Objective-C and I need some help My problem is that I have a subclass of UITextField, and I want to set the placeholder font to be custom with this code - (void)drawPlaceholderInRect:(CGRect)rect { [[self placeholder]…
Bogdan Somlea
  • 604
  • 3
  • 15
3
votes
2 answers

How to detect that speech recogntion is in progress

Problem: I have UITextField side by side with UIButton with send functionality. When user presses send button I'm performing simple action: - (IBAction)sendMessage: (id)sender { [self.chatService sendMessage: self.messageTextField.text]; …
Marek R
  • 32,568
  • 6
  • 55
  • 140
3
votes
2 answers

How to achieve something like NSLineBreakByTruncatingHead for UITextField?

I need to achieve something exactly like NSLineBreakByTruncatingHead for UITextField as shown here. Let's assume the original text is: This is the long text that cannot be shown inside a UITextField I need it like: ...cannot be shown inside a…
Goppinath
  • 10,569
  • 4
  • 22
  • 45
3
votes
0 answers

iOS: Auto expanding Text Field

Before marking as duplicate, I want to say that I've read pretty much all the questions about auto expanding UITextFields, and how they are actually UITextViews instead. The questions I've read definitely works and I've implemented an auto growing…
Ali
  • 5,338
  • 12
  • 55
  • 78
3
votes
1 answer

Emoji keyboard layout is not drawing correctly and is missing many emojis

My app's virtual keyboard for emojis is looking really messed up. The keyboard looks perfectly normal on all other apps on my phone, as well as new projects I tested. The code is simply: UITextField *textField = [UITextField new]; [otherView…
aleclarson
  • 18,087
  • 14
  • 64
  • 91