0

我有一个 UITextField,它是 UIView 的子视图,它设置为 UITableView 的 tableHeaderView。由于某种原因,在 iOS6 中单击时文本字段不会调用键盘(在以前的操作系统中它工作得很好)。

实施非常简单。任何想法可能是什么问题?

谢谢!

4

1 回答 1

0

这是代码:

_tracksTableView.tableHeaderView = _tableHeaderView;  //this view contains the     _playlistNameTextField

- (IBAction)saveButtonClicked
{
    [self toggleTextField];
}

- (void)toggleTextField
{
   if (_textFieldVisible)
   {

    [_playlistNameTextField resignFirstResponder];
    [_playlistNameTextField fadeOut:0.2 delegate:self];
    [_saveAsPalylistButton fadeIn:0.2 delegate:self];
            _textFieldVisible = NO;
    }
   else 
   {
            [_playlistNameTextField setText:@""];
            [_saveAsPalylistButton fadeOut:0.2 delegate:self];
            [_playlistNameTextField fadeIn:0.2 delegate:self startSelector:nil      stopSelector:@selector(launchKeyboard)];
            UIBarButtonItem *barButton = [self barButtonItemWithTitle:NLS(@"Cancel") action:@selector(toggleTextField)];
            [barButton.customView setFrame:CGRectMake(0.0, 0.0, barButton.customView.frame.size.width, _playerTitleView.frame.size.height)];
            self.navigationItem.leftBarButtonItem = barButton;
           _textFieldVisible = YES;
    }
}

- (void)launchKeyboard
{
    [_playlistNameTextField becomeFirstResponder];
}
于 2012-10-11T08:49:49.783 回答