带有下一个、上一个和完成按钮的 iOS 键盘,用于 UITableView 中的文本字段

标签 ios uitableview uikeyboard

我有一个 UItableview,其中包含包含文本字段的自定义单元格。 在表格 View 中,我有 5 行,带有自定义单元格。 我想为表格 View 中加载的文本字段实现附件 View (下一个、上一个、完成按钮)。请帮忙。

代码:

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 5;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *simpleTableIdentifier = @"CPMyTableViewCell";

    CPMyTableViewCell *cell = (CPMyTableViewCell *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];

    if (cell == nil) {
        NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CPMyTableViewCell" owner:self options:nil];
        cell = [nib objectAtIndex:0];
    }


    cell.textVw.placeholder = @"text";
    return cell;

}

最佳答案

您可以使用 BSKeyboardControls https://github.com/SimonBS/BSKeyboardControls .

通过它可以很容易地将控件添加到键盘。您还可以在项目中找到示例。

另请查看 this

关于带有下一个、上一个和完成按钮的 iOS 键盘,用于 UITableView 中的文本字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23475290/

相关文章:

javascript - 基于设备的 HTML 响应式链接

ios - 按字典中的时间戳对 TableView 进行排序

ios - iOS8/iOS8苹果系统键盘的高度是多少?

ios - 如何使用swift访问另一个 View Controller 中一个 View Controller 的IBoutlet?

ios - 加载页面后无法在 UIWebview 中更改 UserAgent

ios - 表格 View 单元格的外壳。 swift

c# - 使用空 ActiveSource 在 C# 中模拟按 Backspace 按钮

objective-c - 将旁遮普文本转换为英文文本

ios - MPMoviewPlayer错误[播放]❗️无法将任何项目排队

ios - 处理 uitableview 中的 uibutton 单击导致错误