in Education by
I have a UITextField inside of a UITableView cell. When I rotate the device, the textfield is still the same width it was for Portrait mode. I know that I need to use autoresizing to make the field fill the cell when I am in landscape, but I am not sure how to do this, as I have tried and failed. How would I do this? cell.textLabel.text = @"Email"; UITextField *field2 = [[UITextField alloc] initWithFrame:CGRectMake(110, 10, width, 30)]; field2.adjustsFontSizeToFitWidth = YES; field2.textColor = [UIColor blackColor]; field2.keyboardType = UIKeyboardTypeEmailAddress; field2.returnKeyType = UIReturnKeyNext; field2.placeholder = @"Required"; field2.tag = 3; field2.delegate = self; field2.autoresizingMask = UIViewAutoresizingFlexibleWidth; field2.backgroundColor = [UIColor blueColor]; // Finish building cell field2.autocorrectionType = UITextAutocorrectionTypeNo; field2.autocapitalizationType = UITextAutocapitalizationTypeNone; field2.textAlignment = UITextAlignmentLeft; [field2 addTarget:self action:@selector(updateFields:) forControlEvents:UIControlEventEditingChanged]; field2.text = email; self.emailField = field2; [cell addSubview:field2]; [field2 release]; JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Check if you tableView has Auto Resize subivew is set to YES. Check you are returning YES for all the supported rotations. (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration: (NSTimeInterval)duration{ }

Related questions

0 votes
    What is the best way to get timestamps in iOS and then calculate time on e.g. 2 timestamps? What ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 4, 2022 in Education by JackTerrance
0 votes
    How can we make a UITextField move up when the keyboard is present - on starting to edit?...
asked Mar 9, 2021 in Technology by JackTerrance
0 votes
    I have a UITableView inside a UITableViewCell (Scrolling is disabled for the nested UITableView) Everything works ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 3, 2022 in Education by JackTerrance
0 votes
    I have a UITableView inside a UITableViewCell (Scrolling is disabled for the nested UITableView) Everything works ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 26, 2022 in Education by JackTerrance
0 votes
    I have a UITableView inside a UITableViewCell (Scrolling is disabled for the nested UITableView) Everything works ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 18, 2022 in Education by JackTerrance
0 votes
    I have a UICollection that shows a padlock on cells that locked to users who aren't logged in. ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 16, 2022 in Education by JackTerrance
0 votes
    Hello I am using native UITableViewCell in my UITableView. When I set the image of the cell it looks ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 10, 2022 in Education by JackTerrance
0 votes
    I am creating an UITableView using auto layout and prototype cells. I would like it to act more like ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
...