我有两个tableviews,每个tableview中只有一个细胞含有,现在我想一个UIWebView中加入这两tableviews'细胞一个UIWebView中加入的UITableViewCell 2个UITableViews
- (void)loadView
{
interestView = [[UIWebView alloc] initWithFrame:_webViewFrame];
interestView.delegate = self;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell"];
}
//interestView is UIWebView
if (tableView == interestTableView) {
[cell.contentView addSubview:interestView];
}else if (tableView == headerTableView) {
[cell.contentView addSubview:interestView];
}
}
,但这是不行的,两个表格单元格都不显示UIWebView。任何想法?
你的意思是说,你的两个tableView只有一个单元格,并且在那个单元格中你想添加一个UIWebView? – 2012-07-24 10:53:30
这是非常奇怪的情况...什么是'interestView'?如何被inited? – holex 2012-07-24 11:06:49
@NayanChauhan是的,正确的,和UIWebView是一样的 – 2012-07-24 15:00:47