uitextfield

UITextField in UITableView cell is returning null

时间秒杀一切 提交于 2019-12-30 11:14:39
问题 I've been banging my head against the wall on this one for quite some time now. Any input or direction is greatly appreciated. So the goal is the create a log in form from text fields in a table. That user info, once collected will be passed on to an array in a seperate view controller so in can stored in a "favourites" list. So I've created the form which looks great and all but when I console out the form results the fields are return (null). I've picked the site for answers but can't

UITextField in UITableView cell is returning null

情到浓时终转凉″ 提交于 2019-12-30 11:13:29
问题 I've been banging my head against the wall on this one for quite some time now. Any input or direction is greatly appreciated. So the goal is the create a log in form from text fields in a table. That user info, once collected will be passed on to an array in a seperate view controller so in can stored in a "favourites" list. So I've created the form which looks great and all but when I console out the form results the fields are return (null). I've picked the site for answers but can't

Use entered text from view in other view in Swift (Xcode 6)

天涯浪子 提交于 2019-12-30 10:25:54
问题 I am almost completely new to Swift and Xcode so excuse my lack of knowledge in this field. At the moment I have a view controller with a label in it. I want to add a view before that, with a text field in which a user enters a name, the app then goes to the second view with the label in which the name entered by the user is placed on the label. I know this is very basic, but I cannot find any good solutions since I'm not quite sure what to search for. If anyone has a piece of code or a link

EXC_BAD_ACCESS in UITextField while typing

不问归期 提交于 2019-12-30 08:53:06
问题 I created a brand new view-based project and added into the viewDidLoad - (void)viewDidLoad { [super viewDidLoad]; myField = [[UITextField alloc] initWithFrame:CGRectMake(50, 50, 150, 31)]; myField.delegate=self; [self.view addSubview:myField]; [myField release]; } my header file is @interface textfieldpracticeViewController : UIViewController<UITextFieldDelegate>{ UITextField *myField; } when i click in the textfield and the keyboard pops up, i start typing but on the 2nd character, i get

Allowing only alphabets in textField

半腔热情 提交于 2019-12-30 07:27:07
问题 I want to make a UITextField to accept only characters and display error when numbers or special characters are entered.But when Im doing so ,when I enter alphabets also error is displayed.Could not understand where I going wrong? NSString *FNameReg=@"[A-Za-z]"; NSPredicate *FNametest=[NSPredicate predicateWithFormat:@"SELF MATCHES %@",FNameReg]; if(![FNametest evaluateWithObject:txtfirstname.text]) { lblvalidateFName.hidden=NO; [testScroll setContentOffset:CGPointMake( 0 , 74)]; return; }

In custom Prototype Cell in UITableView, UITextField value replaces with other Prototype Cell

时间秒杀一切 提交于 2019-12-30 07:18:27
问题 I have taken one UITableView and inside that I have used 2 prototype cells, now in those prototype cells, i have taken 1 UITextField . Now when I run the app and enter value in first prototype cell then i scroll UITableView , then first prototype cell's textfield value come to last prototype cell's textfield value. so it replace everytime i scrolldown or scroll up. sometime it goes blank. here is my code - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:

How to move to the next UITextField automatically in Swift

有些话、适合烂在心里 提交于 2019-12-30 07:07:09
问题 I have 2 textFields with NumberPad keyboard type @IBOutlet weak var ourTextField: UITextField! @IBOutlet weak var forThemTextField: UITextField! and I want to automatically move to the other textfield (from ourTextField to forThemTextField) after entering two numbers inside the ourTextField then after going to the other textfield (forThemTextField) and entering 2 numbers I want the keyboard hide automatically I have added a condition to only accept two numbers in my textFields by this code :

UITextField custom background view and shifting text

女生的网名这么多〃 提交于 2019-12-30 04:56:05
问题 I'm trying to use a custom textfield background. The problem is that the text then appears to be too close on the left. I don't see any way to shift the text without subclassing UITextField. So I'm attempting to extend and overwrite - (void)drawTextInRect:(CGRect)rect{ NSLog(@"draw rect"); CGRect newRect = CGRectMake(rect.origin.x+20,rect.origin.y,rect.size.width-20,rect.size.height); [super drawTextInRect:newRect]; } But for some reason the log never prints. I know the subclass is being used

Style all UITextFields at once rather than in each ViewController?

北城余情 提交于 2019-12-30 04:47:10
问题 I'm trying to style all the textfields like so: CGRect frameRect2 = _lastname_field.frame; frameRect2.size.height = 30; _lastname_field.font = [UIFont fontWithName:@"AppleGothic" size:15]; _lastname_field.frame = frameRect2; _lastname_field.backgroundColor= [UIColor whiteColor]; _lastname_field.layer.cornerRadius = 5.0; [_lastname_field.layer setBorderColor: [[UIColor grayColor] CGColor]]; [_lastname_field.layer setBorderWidth: 1.0]; _lastname_field.clipsToBounds = YES; That field looks great

Custom inputView for UITextField , how do I direct input back to the text field?

旧街凉风 提交于 2019-12-29 22:06:17
问题 I have set a custom inputView to my UITextField . I need a way to display the data selected in my custom inputView in the UITextfield . I would like to achieve this the same way the system keyboard does it. Does anyone know how this is done? How does the system keyboard get a reference to the UITextfield that is the first responder? 回答1: How does the system keyboard get a reference to the UITextfield that is the first responder? It just asks the system for the first responder; unfortunately,