我有一个 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/