uitextfield

iPhone Autocomplete

隐身守侯 提交于 2019-12-08 00:33:18
问题 I am creating an iPhone application where I need to display autocomplete functionality for one of the 5 textfield. What could be the best possible way to achieve this. For now I am showing a tableview on the didtextchange delegate method of UITextField. Kindly suggest me better way of doing this. Any suggestion will be appreciated. Thanks. 回答1: You are doing the right thing. This is the generally followed practice. May be you can use a UIPicker but the iphone apps are all about giving users

Ios Swift Override double tap of UItextField

大兔子大兔子 提交于 2019-12-08 00:25:28
I want to write a custom code on double tap on UITextField and block the default text editing and popup of the keyboard. I've tried the following and nothing has worked for me so far. Kindly help me solve this problem. let gestureArray = NamTxtBoxVal.gestureRecognizers var tapGesture = UITapGestureRecognizer() for idxVar in gestureArray! { if let tapVar = idxVar as? UITapGestureRecognizer { if tapVar.numberOfTapsRequired == 2 { tapGesture = tapVar NamTxtBoxVal.removeGestureRecognizer(tapGesture) } } } let doubleTap = UITapGestureRecognizer(target: self, action: #selector(namFnc(_:))) doubleTap

UITextField becomeFirstResponder crashes the iOS app randomly

有些话、适合烂在心里 提交于 2019-12-08 00:25:21
问题 I developed an app which had multiple text fields with the glow border for the text field. It has been working fine when I do an internal testing, but I see the Fabric is reporting the crash with the following stacktrace. Am I missing something to trace this issue? Can anybody give some light on this issue? Thread : Fatal Exception: NSInternalInconsistencyException 0 CoreFoundation 0x185de0f48 __exceptionPreprocess 1 libobjc.A.dylib 0x19a92ff80 objc_exception_throw 2 CoreFoundation

I want customised UITextfield which has placeholder behaviour same as android also i want error label within UITextfield

血红的双手。 提交于 2019-12-07 23:56:24
I want customized UITextfield which has placeholder behavior same as android also I want error label within UITextfield. Recently I have seen in android. They have default text area where placeholder does not get hidden when a user starts writing, Instead of hiding they keep placeholder upside of textarea. indrajit Recently i have created my CustomTextfield class which is same as your requirements. Here is the Github link to download class and its usage https://github.com/indrajitv/CustomTextField Below is the code, // // File.swift // customTextField // // Created by indrajit on 17/08/18. //

iOS: Appending an uneditable string to the end of a UITextView

偶尔善良 提交于 2019-12-07 21:05:04
问题 I would like to reproduce a screen similar to the Facebook "Update Status" view in iOS. (This text should be editable) Walking (Anything past here should not be editable) - at South Narrabeen Beach The user should be able to enter/edit text to the left of the appended string. The appended string will need to wrap within its parent and be clickable. Does anyone know how this is done? (I have recently seen it in the Viddy app as well). Could it be a growing UITextField with a UIAttributedString

Custom class that can be applied to every UITextField - Swift

↘锁芯ラ 提交于 2019-12-07 18:26:31
问题 Im very new to programming and am making a project that will have many UITextFields. I want to have the text fields only have a border on the bottom for a cleaner look, and I found some code here that is supposed to make that happen. let border = CALayer() let width = CGFloat(2.0) border.borderColor = UIColor.darkGray.cgColor border.frame = CGRect(x: 0, y: textField.frame.size.height - width, width: textField.frame.size.width, height: textField.frame.size.height) border.borderWidth = width

UITextField Strange Behaviour When Entering Text

冷暖自知 提交于 2019-12-07 15:04:57
问题 Want to Search this Issue on Google But Do't Know What i need to write for find the exact reason So i am here. ISSUE Create UITextField using Interface Builder and Run the project and while i am entering any value using iOS Keyboard this is what happening and i am confuse. This Happened in One Project and as i created new one everything working fine. Very First Time When App Started on Simulator. Then I Entered single character G using iOS Keyboard Then I Entered Again single character G

UITextField 只允许输入数字和字母 解决联想中文等问题

隐身守侯 提交于 2019-12-07 14:52:36
- (void)reTextFieldDidChange:(UITextField *)textField{//输入文本时调用 //将输入的小写x转换成大写 textField.text = [textField.text stringByReplacingOccurrencesOfString:@"x" withString:@"X"]; //解决联想输入的问题 NSCharacterSet *cs = [[NSCharacterSet characterSetWithCharactersInString:@"Xx0123456789"] invertedSet];//里面放允许输入的字符 textField.text = [[textField.text componentsSeparatedByCharactersInSet:cs] componentsJoinedByString: @"" ]; if (textField.text.length > 18) { textField.text = [textField.text substringToIndex:18]; } } - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range

text简单使用

一笑奈何 提交于 2019-12-07 14:52:20
// 初始化 textfield 并设置位置及大小 UITextField *text = [[UITextField alloc]initWithFrame:CGRectMake(20, 20, 130, 30)]; // 设置边框样式,只有设置了才会显示边框样式 text.borderStyle = UITextBorderStyleRoundedRect; typedef enum { UITextBorderStyleNone, UITextBorderStyleLine, UITextBorderStyleBezel, UITextBorderStyleRoundedRect } UITextBorderStyle; // 设置输入框的背景颜色,此时设置为白色 如果使用了自定义的背景图片边框会被忽略掉 text.backgroundColor = [UIColor whiteColor]; // 设置背景 text.background = [UIImage imageNamed:@"dd.png"]; // 设置背景 text.disabledBackground = [UIImage imageNamed:@"cc.png"]; // 当输入框没有内容时,水印提示 提示内容为 password text.placeholder = @"password"; //

UITextField 常用属性

给你一囗甜甜゛ 提交于 2019-12-07 14:51:59
// 初始化 textfield 并设置位置及大小 UITextField *text = [[UITextField alloc]initWithFrame:CGRectMake(20, 20, 130, 30)]; // 设置边框样式,只有设置了才会显示边框样式 text.borderStyle = UITextBorderStyleRoundedRect; typedef enum { UITextBorderStyleNone, UITextBorderStyleLine, UITextBorderStyleBezel, UITextBorderStyleRoundedRect } UITextBorderStyle; // 设置输入框的背景颜色,此时设置为白色 如果使用了自定义的背景图片边框会被忽略掉 text.backgroundColor = [UIColor whiteColor]; // 设置背景 text.background = [UIImage imageNamed:@"dd.png"]; // 设置背景 text.disabledBackground = [UIImage imageNamed:@"cc.png"]; // 当输入框没有内容时,水印提示 提示内容为 password text.placeholder = @"password"; //