0
我将一些UITextFields,UITextViews和UIImageViews作为子视图添加到UITableCell中。当我向TextFields或TextView输入一些文本并向上或向下滚动表格时,出现一些绘图问题。每秒场的文字重叠等领域是这样的:iPhone SDK - UITableCell的UITextField子视图给出绘图问题?
alt text http://i49.tinypic.com/2gsl4dh.png
我创建表单元素是这样的:
self.formFields = [[NSArray alloc] initWithObjects:
[[UITextField alloc] initWithFrame:CGRectMake(18.0, 10.0, 284.0, 22.0)],
[[UITextView alloc] initWithFrame:CGRectMake(18.0, 8.0, 284.0, 140.0)],
[[UITextField alloc] initWithFrame:CGRectMake(18.0, 10.0, 284.0, 22.0)],
[[UITextField alloc] initWithFrame:CGRectMake(18.0, 10.0, 284.0, 22.0)],
[[UIImageView alloc] initWithFrame:CGRectMake(18.0, 18.0, 284.0, 284.0)],nil];
并添加子视图:
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath {
...
[cell addSubview:[self.formFields objectAtIndex:indexPath.section]];
return cell;
}
有没有什么办法解决这一问题?