【发布时间】:2016-08-19 09:13:51
【问题描述】:
我正在实现一个UIScrollView,它包含一些用户数据。我正在从我的服务器下载其他数据。下载后,我的UIScrollView 的contentSize 应该是原始大小 + 单元格数乘以它们的高度。
所有UIViews 都对齐并以编程方式设置。
UITableView 是最低的,应该始终拉伸到屏幕底部。
在我的 viewDidLayoutSubviews 我设置了以下内容
groupsCountLbl.frame = CGRectMake(groupsLbl.frame.maxX + 5,
seperatorLbl.frame.maxY + 15 , 40, 20)
groupsCountLbl.sizeToFit()
table.frame = CGRectMake(0, groupsCountLbl.frame.maxY + 10,
bounds.width, bounds.height - groupsCountLbl.frame.maxY + 10)
scrollView.contentSize = CGSizeMake(bounds.width, bounds.height
+ self.table.frame.height)
scrollView.scrollEnabled = true
【问题讨论】:
-
你的应用支持自动布局吗?
-
是的,它支持自动布局。例如单元格与 autoLayout 对齐
标签: ios uitableview uiscrollview cgrectmake