昨天在折腾UITableView,最终想实现的效果是在UITableViewCell里添加UIScrollView, spa
效果图以下: 设计
初步设计是用代码生成UITableView,因此没有用到IB来建立View等控件。 图片
几经波折,在自定义TableViewCell里成功添加了UIScrollView,而scrollview里面动态添加了N张远程图片。 it
可是Cell的高度始终都是原始的44像素,因为Cell里面的图片都是有固定大小,因此在 table
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 搜索
{
return 128.0;
} scroll
self.PhotoDetailTable = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, screenFrame.size.width, screenFrame.size.height-93) style:UITableViewStylePlain]; im
self.PhotoDetailTable.dataSource = self; img
self.PhotoDetailTable.delegate = self; tab
OK,运行后,Cell高度正常显示为128