uitextfield

TextField becomeFirstResponder Issue for tab key(Keyboard) action

删除回忆录丶 提交于 2019-12-08 15:46:59
问题 I have a view in XIB where i used several text fields in it. Let say the first text field becomes first responder as soon as the view gets loaded in the window. If i press tab key in my machine's keyboard to navigate to next text field ;apart from the immediate text field, all other text fields are also becomes first responder and the textfield begin editing delegate menthod gets called for all the text fields. What could be the issue ? This will occur not only in simulator when we use

Size of bullets in UITextField with secureTextEntry changes size as focus switches when using custom font

牧云@^-^@ 提交于 2019-12-08 14:35:01
问题 I have a UITextField that is using the Museo Sans Rounded 300 font. Everything works fine for normal UITextFields, but when you set the secureTextEntry = YES , then there's this disconcerting change to the size of the bullets as the UITextField gets and loses focus (i.e. becomes, and relinquishes, being the first responder). When the UITextField has focus, the bullets appear to be using the custom font, but once it loses focus they change to being these much bigger (standard size) bullets.

iOS UIText Field Place holder font size/style

拥有回忆 提交于 2019-12-08 14:14:13
问题 Anybody know of a way you can set the font size for a Placeholder in a UITextField? Thanks for any help 回答1: You can do it by programmatically setting up the value for the key @"_placeholderLabel.font" [self.input setValue:[UIFont fontWithName: @"American Typewriter Bold" size: 20] forKeyPath:@"_placeholderLabel.font"]; 回答2: I found out the font size and style for the placeholder font can be adjusted by setting the font style for the actual text in interface builder. 回答3: You can override

How to check in Swift if a Regular Expression is valid?

拈花ヽ惹草 提交于 2019-12-08 13:46:19
问题 I'm using Regex to search in a textView. All works fine with simple strings but when I try to enter only a part of a regular expression operator I get a cash with the error: Error Domain=NSCocoaErrorDomain Code=2048 "The value “\” is invalid." UserInfo={NSInvalidValue=\} For example if I enter "\n" it works, but if I enter only "\" (without quotes), I get the crash. What I can't get to do is to find a way to check the expression before to use it. I'm using this code partially based on this

UITextField in UITableViewCell and validation in modal view

落爺英雄遲暮 提交于 2019-12-08 12:39:21
问题 I am using the approach described in this stackoverflow posting to retrieve values from a textfield. My problem is that the tableview is presented modally and I have a save button that validates the input and stores it. The problem is that the textFieldDidEndEditing method is not called when the user clicks an UIBarButtonItem (= the save button, which closes the modal view). In this event (when the user wants to save the input) I would like to validate it. But the values are stored in

What is the Best Way To show UITextField with only a bottom border?

蹲街弑〆低调 提交于 2019-12-08 12:32:27
I would like to have UITextField appear only with a bottom border. See the designer's image below: UIBezierPath *path = [UIBezierPath bezierPath]; [path moveToPoint:CGPointMake(150.0, 350.0)]; [path addLineToPoint:CGPointMake(250.0, 209.0)]; CAShapeLayer *shapeLayer = [CAShapeLayer layer]; shapeLayer.path = [path CGPath]; shapeLayer.strokeColor = [[UIColor blueColor] CGColor]; shapeLayer.lineWidth = 3.0; shapeLayer.fillColor = [[UIColor clearColor] CGColor]; I have Tried This but not Getting Appropriate Results. Any Suggestions ? 来源: https://stackoverflow.com/questions/25976119/what-is-the

Popup UIPicker when tapping on UITextField

為{幸葍}努か 提交于 2019-12-08 12:24:14
问题 I need to display/show a Picker when a user taps on a textfield, I mean, it should appear a picker instead of a keyboard. Also, some sort of "done" button above the picker so the user clicks on it and the value from the picker is copied to the textfield and the picker is hidden again. I've checked many tutorials from the web but haven't found anyone that can really help me. I found a tutorial that pointed me in the right direction but I'm still missing to disappear the keyboard when clicking

How do I know if the text of a UITextField has been modified by user

老子叫甜甜 提交于 2019-12-08 10:42:40
问题 I work on a project for iPhone iOS 4 and Xcode 4. There is a method to know if the text of a UITextField ha been modified by the user? For example,I have 2 UITextField, textFieldA and textFieldB, and suppose that textField contains some text as "abc". The user first tap in textFieldA (keyboard opens), and then in textFieldB. How can I know if the text in textFieldA has been modified by the user? Thank you. 回答1: How about: First subscribe to the text field delegate in your header file with:

Adjust View for keyboard appears when switching UITextField (Swift)

余生颓废 提交于 2019-12-08 10:19:57
问题 I have two UIView's , the Main one and one which will move up when the keyboard appears (Second UIView has two textfields). I've managed to do this with the following code: LoginViewController.swift : override func viewDidLoad() { super.viewDidLoad() self.originalCenter = self.contentView.center; NSNotificationCenter.defaultCenter().addObserver(self, selector: "keyboardDidShow:", name: UIKeyboardDidShowNotification, object: nil) } func keyboardDidShow(notification: NSNotification) { UIView

Content of UITextFiled gets trimmed when removing the border

自古美人都是妖i 提交于 2019-12-08 09:52:18
问题 For my UITextField, I want the border to be removed. So, I tried changing its border color to the background color (with border width of 1) but doing so, faint border lines are seen at the corners. Next, I set the border style to none in the attribute inspector. When I run the app, the border is gone. However, when the text is entered in it, the text gets cropped in the left side as shown in the image. I tried adding padding view to the textfield but it did not fix the issue. How can I solve