Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID
Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.

UITextField inside UITableView

Hi,
I insert in my tableview the textfields i have created and it works. But when i click the "Done" button, nothing happens. It can't reach the textFieldShouldReturn function so it can't reach [textField resignFirstResponder].
An idea?
Post edited by jbe on

Replies

  • jbejbe Posts: 2New Users
    jbe;120436 said:
    Hi,
    I insert in my tableview the textfields i have created and it works. But when i click the "Done" button, nothing happens. It can't reach the textFieldShouldReturn function so it can't reach [textField resignFirstResponder].
    An idea?
    Ok, my problem was the delegate! I solve it on myself
  • funnylookinhatfunnylookinhat Posts: 9New Users
    JBE - How are you able to put UITextFields into your UITableView?? I'm trying to do it and can't figure it out...
  • zeeshanzeeshan Posts: 8New Users
    JBE - How are you able to put UITextFields into your UITableView?? I'm trying to do it and can't figure it out... please reply

    zeeshan khan
  • zeeshanzeeshan Posts: 8New Users
    funnylookinhat - Did you get success in putting UITextField into your UITableView. Please let me know if you done it.
    Thanks in advance
  • funnylookinhatfunnylookinhat Posts: 9New Users
    zeeshan;189574 said:
    funnylookinhat - Did you get success in putting UITextField into your UITableView. Please let me know if you done it.
    Thanks in advance
    Yes, there are a couple of ways you can do this.

    The easiest way is to create UITableViewCells with Interface Builder, and put text fields in them. Link both the cell and the text field to whatever controller manages the datasource/delegate for the UITableView.

    So for example, let's say you create the following:
    IBOutlet UITableViewCell *cell1;
    UITextField *text1;
    IBOutlet UITableViewCell *cell2;
    UITextField *text2;
    IBOutlet UITableViewCell *cell3;
    UITextField *text3;


    In your cellForRowAtIndexPath function you would do the following:
    if([indexPath row] == 0) {
    return cell1;
    } else if([indexPath row] == 1) {
    return cell2;
    } else {
    return cell3;
    }


    Then you can just reference the text fields as normal - connect them with interface builder, etc.

    Does that help?
  • kguptakgupta Posts: 26Registered Users
    Can we display a UITextField in side a UILabel and this UILabel is a cell in UITableView.

    funnylookinhat;189614 said:
    Yes, there are a couple of ways you can do this.

    The easiest way is to create UITableViewCells with Interface Builder, and put text fields in them. Link both the cell and the text field to whatever controller manages the datasource/delegate for the UITableView.

    So for example, let's say you create the following:
    IBOutlet UITableViewCell *cell1;
    UITextField *text1;
    IBOutlet UITableViewCell *cell2;
    UITextField *text2;
    IBOutlet UITableViewCell *cell3;
    UITextField *text3;


    In your cellForRowAtIndexPath function you would do the following:
    if([indexPath row] == 0) {
    return cell1;
    } else if([indexPath row] == 1) {
    return cell2;
    } else {
    return cell3;
    }


    Then you can just reference the text fields as normal - connect them with interface builder, etc.

    Does that help?
  • funnylookinhatfunnylookinhat Posts: 9New Users
    kgupta;248127 said:
    Can we display a UITextField in side a UILabel and this UILabel is a cell in UITableView.
    No - You can't. The reason is that a UILabel does not possess a view property - so you can't make a UITextVield (View) the view within a UILabel.

    What exactly are you trying to do? Having a UITextField inside a UILabel inside a UITableView seems quite roundabout.
  • kguptakgupta Posts: 26Registered Users
    I want to display 7 UITextFiels in UITableView cell in one line. How can it be done.

    Thanks.
    funnylookinhat;248161 said:
    No - You can't. The reason is that a UILabel does not possess a view property - so you can't make a UITextVield (View) the view within a UILabel.

    What exactly are you trying to do? Having a UITextField inside a UILabel inside a UITableView seems quite roundabout.
Sign In or Register to comment.