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;
}
有沒有什麼辦法解決這一問題?