UITableViewCell中的UITextField iPad上没有键盘,但iPhone正常

UITableViewCell中的UITextField iPad上没有键盘,但iPhone正常,ipad,uitableview,uitextfield,Ipad,Uitableview,Uitextfield,我有一个tableView,它有几个以文本字段作为子视图的表格单元格 self.cellFirstName = [[UITableViewCell alloc] initWithFrame:cellRectangle]; self.tfFirstName = [[UITextField alloc] initWithFrame:Field1Frame]; self.tfFirstName.tag = 1; self.tfFirstName.delegate = self; self.tfFirs

我有一个tableView,它有几个以文本字段作为子视图的表格单元格

self.cellFirstName = [[UITableViewCell alloc] initWithFrame:cellRectangle];
self.tfFirstName = [[UITextField alloc] initWithFrame:Field1Frame];
self.tfFirstName.tag = 1;
self.tfFirstName.delegate = self;
self.tfFirstName.placeholder = @"First Name";
[self.cellFirstName addSubview:self.tfFirstName];

触摸真实iPad上的文本字段或单击iPad模拟器上的文本字段时,键盘不会弹出。
Works find on real and sim iPhone。

不知怎的,我什么也做不到让键盘弹出


如果我将其中一个文本字段设置为第一响应者,则会显示一个键盘,
但当我关闭键盘并点击任何文本字段时,会显示一个键盘-无-无键盘。

单击或触摸文本字段只会使其变为蓝色

我甚至把iPhone故事板复制到iPad上

将targetRuntime更改为“iOS.CocoaTouch.iPad”
结果仍然相同。

下面是我用来让它工作的方法:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if(indexPath.section == 0) {
        [self.tfFirstName becomeFirstResponder];
    }
    if(indexPath.section == 1) {
        [self.tfLastName becomeFirstResponder];
    } ...

我宁愿理解是什么阻止了键盘弹出。

如果你有一些关于
iPad
的特殊代码,我想也许你已经设置了
tfFirstName.userInteraction=NO和/或
tfFirstName.enabled=否
委托
方法之一,在设备处于
iPad
状态时返回
NO
。请检查这些选项。

谢谢您的快速响应,您的建议不会产生相反的效果吗(我想要交互,我想要一个键盘),我尝试了所有设置UserInAction的组合,并启用为“否”,但没有效果。您是否意识到导致这种情况的任何iPad ISM?另外,您指的是哪些委托方法。再次感谢您的快速响应。您误会了,我说您必须检查是否将交互设置为“否”,因为“否”被设置为“是”。在我之前尝试查找问题时,我记录了这些值,结果是“是”,所以问题出在其他地方。你能分享这个项目让我试试吗?如果这是我自己的小项目,那么我会,但这是一个客户付钱给我创建的应用程序,当我有时间时,我会尝试用一个简单的项目重新创建条件,并直接与你联系。
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if(indexPath.section == 0) {
        [self.tfFirstName becomeFirstResponder];
    }
    if(indexPath.section == 1) {
        [self.tfLastName becomeFirstResponder];
    } ...