How can I show that the keyboard is displayed on the touch screen as a table (iphone)

I am working on one application, now I need a label on the tableview cell, and when the user clicks on this label, then the keyboard will show how we do it, can someone tell me. I searched, but everyone where they use the notification, I do not want this.

thank

-(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];
  }
 cell.textLabel.text=[Players objectAtIndex:indexPath.row];

 playername=[[UITextField alloc]initWithFrame:CGRectMake(10, 5, 100, 30)];  
 playername.placeholder=@"Player";
 playername.delegate=self;
 playername.keyboardType=UIKeyboardTypeDefault;
 playername.returnKeyType=UIReturnKeyDone;
 [cell.contentView addSubview:playername];


 cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
 return cell;

 }
+3
source share
1 answer

This is weird in your application that does not use UITextField or UITextView

but if you want this you can create an invisible UITextField or UITextView to display the keyboard

UITextField *tf = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
[self.view addSubview:tf];
[tf becomeFirstResponder];

so you can handle UITextFieldDelegate input

+1
source

All Articles