Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8827857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:28:22+00:00 2026-06-14T07:28:22+00:00

Having a UITextField in a UITableViewCell I’m making a fill-out form (First name, Middle

  • 0

Having a UITextField in a UITableViewCell

I’m making a fill-out form (First name, Middle Init, Last Name) using table views and want to embed text fields in some of my cells. I see a lot of examples on adding a UITextField inside a UITableViewCell, like the one above. However ALL of them have hard-coded values for the text field’s frame, like this

UITextField *playerTextField = [[UITextField alloc] initWithFrame:CGRectMake(110, 10, 185, 30)];

I want my text field to use the cell’s frame or bounds.

To make things more interesting, my table view has four sections, and only section 1, which has 3 rows, will have text fields embedded.

To make things even more interesting, I use a popup controller to present my form.

So how can I embed my text field to fit properly inside my table view cells without using hard-coded values when setting its frame or bounds?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:28:23+00:00Added an answer on June 14, 2026 at 7:28 am

    Autoresizing masks are your friend.

    cell = [tableView dequeueReusableCellWithIdentifier:@"identifier"];
    CGFloat optionalRightMargin = 10.0;
    CGFloat optionalBottomMargin = 10.0;
    UITextField *playerTextField = [[UITextField alloc] initWithFrame:CGRectMake(110, 10, cell.contentView.frame.size.width - 110 - optionalRightMargin, cell.contentView.frame.size.height - 10 - optionalBottomMargin)];
    playerTextField.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    [cell.contentView addSubview:playerTextField];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying out KIF for iOS testing and am having trouble with UITextField
For some reason, I'm having trouble with making a textfield the first responder. I
Possible Duplicate: Having a UITextField in a UITableViewCell I try to do it for
I am having UIAlertview with UITextField in that.Mine is iPad application -(void)showAlertToAddLink { alertToAddLink
I am having one UITextField label as Password and Username. I have to convert
I've been having some issues with calling -becomeFirstResponder on a UITextField contained with a
I have a UITableView with a few UITableViewCell s. Each cell contains a UITextfield
I'm having some issues with my table that has UITextFields in each cell. I
I am making an app that posts content from a UITextField, to a PHP
In my iphone application there is 4 forms. These forms are having UITextField, UITextView,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.