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.
Question posted in Xcode
Whether you're new to Xcode or an experienced developer, our archive has everything you need to know about this integrated development environment (IDE). From basic functionalities to advanced features, our archive covers a wide range of Xcode-related questions and answers. Browse our archive now and find solutions to your Xcode questions, and take your app development skills to the next level
Whether you're new to Xcode or an experienced developer, our archive has everything you need to know about this integrated development environment (IDE). From basic functionalities to advanced features, our archive covers a wide range of Xcode-related questions and answers. Browse our archive now and find solutions to your Xcode questions, and take your app development skills to the next level
2
Answers
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 aUIScrollView
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 insideUITableViewCells
UIStackView
that you will dynamically update to expand / collapse rows instead of aUITableView
and have that in your scrollview.