简体   繁体   English

IOS Swift Tableview controller 嵌入在容器视图中未滚动到 tableview 列表项的底部

[英]IOS Swift Tableview controller embedded inside container view is not scrolling to the bottom of the tableview list items

I m having issue with tableview trying to be displayed inside container view, the top item is okay, but on scrolling it doesn't scroll to the bottom to show the bottom item, The containerView height is almost half height of the screen, but the tableview controller is full screen one, what i wanted to achieve is to display tableview inside container view, with all smooth scrolling capability, I have succeeded with displaying it, but the issue is with scrolling behaviour, which is not smooth and doesnt scroll to the bottom of it我在尝试在容器视图中显示 tableview 时遇到问题,顶部项目还可以,但是在滚动时它不会滚动到底部以显示底部项目, containerView 高度几乎是屏幕高度的一半,但是tableview controller 是全屏之一,我想要实现的是在容器视图中显示 tableview,具有所有平滑滚动功能,我已经成功显示它,但问题在于滚动行为,它不平滑并且不会滚动到它的底部

any help would be appreciated.任何帮助,将不胜感激。

this might help you, I have had same issue before, the problem your having is all about re-arranging the height of tableview to fit into containerview one, so update the height of the tableview view controller into the frame height of container view, like this:这可能对你有帮助,我之前遇到过同样的问题,你遇到的问题是重新安排 tableview 的高度以适应 containerview 之一,所以将 tableview 视图 controller 的高度更新为容器视图的框架高度,比如这个:

tableViewController.view.frame.size.height = containerView.frame.size.height tableViewController.view.frame.size.height = containerView.frame.size.height

you can also change the width to fit it also as your requirement,您也可以根据需要更改宽度以适应它,

this way i solved my issue.这样我解决了我的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM