uitextfield

iOS 8 Messages To Token Field?

 ̄綄美尐妖づ 提交于 2019-12-01 17:24:20
问题 How do I build a token text field like that of the iOS 8 Messages app that allows you to tokenize one or more words so that you can select, copy, and cut one or more of them at a time? Note: I've seen open source projects like this, but they work the old way, which only allows one token to be selected at a time. 来源: https://stackoverflow.com/questions/27000943/ios-8-messages-to-token-field

How can I set an accessibility trait for the placeholder text in UITextField?

一笑奈何 提交于 2019-12-01 17:17:43
I'm going through our iOS app to fix accessibility issues. One of the features of the app is a UITextField in which the user can enter search queries. I've set the trait of the field to be "search field", and VoiceOver does a good job with the field most of the time. When there's text in the field, it reads the text, then says "search field". The problem I want to solve is how VoiceOver handles the placeholder text. When the text field is empty, we've set the placeholder text to show a sample query. Since it appears as greyed-out text, sighted users can see that it's just the placeholder text.

How to give Placeholder for TextField of Settings Bundle (Root.plist)

懵懂的女人 提交于 2019-12-01 17:15:06
问题 I want to give placeholder for textfield of Settings bundle (Root.plist) is it possible?if yes how? Thanks in advance 回答1: I'm afraid currently it's not possible - I was also trying to do that but can't seem to find any working solution. If that helps, the official docs where this should be placed are here. 来源: https://stackoverflow.com/questions/13757735/how-to-give-placeholder-for-textfield-of-settings-bundle-root-plist

iphone: uitextfield, multiple textfields with the same delegate?

牧云@^-^@ 提交于 2019-12-01 16:56:25
问题 there are two different textfields in my applications and i set the .delegate property of both of them to: self. Now i implemented different methods from the uitextfielddelegate protocol but i want to be able to control the two textfields individually. For instance i want the first text field to do something different when editing begins than the second textfield... Is the only solution to this problem to set the assign a different delegate or is there a way to do this with both of the

UITextField Crash in Simulator not in iPhone 4 (4.2)

别来无恙 提交于 2019-12-01 14:44:52
I'm facing a strange issue and have no idea how to solve it. I have in my app a simple viewcontroller with 3 textfield. I have define them as IBOutlet in my .h and linked them with the file's owner. Two of them are define with default Keyboard, the other use phone pad keyboard. When i Try to edit the phone field (phone pad keyboard) it's ok. Keyboard appear, field can be modify. When i try to edit one of the 2 others, then the app crash for the reason :"Terminating in response to SpringBoard's termination." I did not receive memory warning. This works fine if i try it on the iPhone 4 iOS 4.2

UiTextfield- First letter must be 0

自作多情 提交于 2019-12-01 14:44:18
I am using phone number texfield, now i am using this format for texfield (#) ### ### ###, now issue is that i want first character 0 as compulsary, like this (0) 959 554 545, so user enter whatever first character must be typed 0, this is my code func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { let newString = textField.text if ((newString == "") && (newString?.count == 0)){ txtMobileNumber.text = "0" return true }else if ((newString?.count)! > 0){ return true } return false } In shouldChangeCharactersIn method

Return Inputs to UITextfield with custom inputView

谁都会走 提交于 2019-12-01 14:23:06
i created a UITextField and a custom View. after that i added this custom view as "inputView" to my UITextField. amountKeyboardViewController *amountKeyboard = [[amountKeyboardViewController alloc] initWithNibName:@"amountKeyboardViewController" bundle:nil]; amountTextField.inputView = amountKeyboard.view; [amountTextField becomeFirstResponder]; this works quite fine. but can i fill my "amountTextField" with the input clicked in my custom View (UIButtons)? thanks for some hints ! in your amountTextField controller you need to write the following code in .h file create property of your

Ignore Tab character in UITextField… (iPad app)

坚强是说给别人听的谎言 提交于 2019-12-01 14:05:33
问题 I have a TableView with TextFields in each cell and I want to those textfields ignore the character tab ( \t ). When the tab key is pressed, the textField:shouldChangeCharactersInRange method it's not called Does anyone knows how to do this? I know that there is no tab key in the iPad keyboard but the blutooth and dock ones do and triggers a really weird behavior. Thanks 回答1: This seems to be a problem with the tab ( \t ) character. This character is not handled like normal characters (e.g. a

Type in two uitextfield at the same time

走远了吗. 提交于 2019-12-01 14:04:54
I want to type in two uitextfield at the same time.Is this possible? You can do it using the following code: Typein2.h - class where three textFields are declared. The "textFieldBeingEdited" textField is to know which textField (text1 or text2) is being edited #import <UIKit/UIKit.h> @interface Typein2 : UIViewController <UITextFieldDelegate> { UITextField *text1; UITextField *text2; UITextField *textFieldBeingEdited; } @property (nonatomic, retain) IBOutlet UITextField *text1; @property (nonatomic, retain) IBOutlet UITextField *text2; @end In the viewDidLoad method do the following: - (void

Type in two uitextfield at the same time

让人想犯罪 __ 提交于 2019-12-01 13:47:42
问题 I want to type in two uitextfield at the same time.Is this possible? 回答1: You can do it using the following code: Typein2.h - class where three textFields are declared. The "textFieldBeingEdited" textField is to know which textField (text1 or text2) is being edited #import <UIKit/UIKit.h> @interface Typein2 : UIViewController <UITextFieldDelegate> { UITextField *text1; UITextField *text2; UITextField *textFieldBeingEdited; } @property (nonatomic, retain) IBOutlet UITextField *text1; @property