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

  • SEARCH
  • Home
  • 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 5997221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:13:57+00:00 2026-05-23T00:13:57+00:00

I added uitextfield programatically to uitableview cell, the problem is when I type on

  • 0

I added uitextfield programatically to uitableview cell, the problem is when I type on the textfield and click done or move from the textfield the keyboard doesn’t disappear.

Any suggestion to solve that?

@interface test_20110605ViewController : UIViewController <UITextFieldDelegate> {

    UITextField *PtienttextField ;
}

@property ( nonatomic , retain ) UITextField *PtienttextField ;

@end

at m file 

@implementation test_20110605ViewController

@synthesize PtienttextField ;


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease];

        if (indexPath.row == 0 && indexPath.section == 1 ) {


            //cell.textLabel.text = "Patient Name";



            UILabel *PatientLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 120, 25)];
            PatientLabel.backgroundColor = [UIColor clearColor];
            PatientLabel.tag = 1;
            PatientLabel.text = @"Patient Name" ; 
            [cell.contentView addSubview:PatientLabel];

            PtienttextField = [[UITextField alloc]initWithFrame:CGRectMake(140, 10, 400, 30)];

            PtienttextField.clearsOnBeginEditing = YES;
            PtienttextField.textAlignment = UITextAlignmentRight;
            PtienttextField.returnKeyType = UIReturnKeyDone;
            PtienttextField.delegate = self;
            //PtienttextField.tag = 2 ; 
            [PtienttextField setBorderStyle:UITextBorderStyleBezel];
            [cell.contentView addSubview:PtienttextField];
        }
    }

    // Configure the cell.

    return cell;
}

- (BOOL)textFieldShouldReturn:(UITextField *)textField{


    return YES;
}

@end
  • 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-05-23T00:13:58+00:00Added an answer on May 23, 2026 at 12:13 am

    I think you’re missing the following in textFieldShouldReturn:

    [textField resignFirstResponder];
    

    then your return YES;

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to edit the user's username inside a UITableView. I added a UITextField
I have a UITextField that has been added to my view in Interface Builder.
I've subclassed some UITextField and added some custom properties. In a UITableViewController, in the
How to set Custom keyboard specific to only a UITextField ? When I am
Is there a way to hide UIAlertView programmatically? Actually I have added a UITextField
I have created three UIImageViews. I then added a UITextField to each image as
i added ascx control in tab control with C# codes. if you click any
Added: Working with SQL Server 2000 and 2005, so has to work on both.
Added : I am conducting a study for a new system we're going to
ADDED: This question is now, I believe, subsumed by this one: Using GNU Screen

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.