ios 8 nested auto sized tables

試著忘記壹切 提交于 2019-12-07 06:09:14

问题


I'm pretty new to Auto Layout, so this may be an easy question to answer. I have two UIViewControllers which both contain UITableViews that need to auto-size their cells. I'm trying to use Auto Layout and the new iOS 8 auto-sizing table cells. There is a parent/child relationship between these tables: the parent table view will display the child's table view in its cells.

The child's table view seems to auto-size just fine (the cells at least). The problem is that the parent cell seems unable to determine the size of the child table view.

What I see in a debug session is that the parent cell appears to be truncating the child's view. To be more specific, when I inspect the view hierarchy, I can see that the child table view's cells are auto-sized correctly, but the child table view seems to be set to the size of the parent cell (or some sort of default value) and not to its contents.

I have a repro project that demonstrates the problem. I think it may have something to do with UIScrollView and Auto Layout. I've read other posts on this topic which seem related. If that's the case, I need a little help figuring out how to apply that to my repro project.

来源:https://stackoverflow.com/questions/26435778/ios-8-nested-auto-sized-tables

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!