I want to use tableview inside scrollview. and I want to give height to the tableview as 150 or greater than but as soon as I am doing so It's showing error. My actually I have to implement collasible cell in the tableview. So I do't want to give height of the table programatically. I want it should be adjustable by storyboard.
I think your method is not efficient. cz tableview scrollable to, why do you need scroll view. let's make it simple, try this:
if you don't want use tableview only, make tableview and scrollview high contsraint dinamicly. make sure your scrollview high is higher than your tableview. and last disable userinteraction on your tableview. so your tableview will stack on your scrollviw.
Thanks, CMIW
A UITableView
within a UIScrollView
is never a good idea. It can lead to many problems. My suggestion would be:
UITableView
with all the items currently in the scrollview beeing inside UITableViewCells
UIStackView
that you will dynamically update to expand / collapse rows instead of a UITableView
and have that in your scrollview.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.