0

I have a dynamically created tableView in XCode which generates cells from an array. Currently, the cells do not fill the entire screen, that's to say that there are empty rows beneath them. How do I get them to fill any screen size for any iOS device at any orientation, please? Also, in another tableview, more array items populate the table - but then I can't scroll to view them all. How do I enable scrolling in a tableview? So, in summary, how can I get my populated cells to fill the screen of any iOS device? And, how do I enable scrolling? Thank you very much :) I really need help!

Don Draper
  • 87
  • 1
  • 1
  • 6

1 Answers1

0

I am unsure of what you are asking because you haven't supplied enough information to determine exactly what task you are attempting to complete. Can you be more specific about what you are trying to do?

I can advise on your request for how to scroll, though. If you want to scroll, you'll have to nest the TableView as a child of a parent ScrollView. You can enable scrolling in the ScrollView, which will then allow you to scroll through the content in the child TableView.

Michael Fourre
  • 3,005
  • 3
  • 15
  • 26
  • Thanks for your swift (pun intended) response! I have a tableview - 6 populate cells - how can I get these to fill the whole screen? Right now I have those 6 cells and like 10 empty cells below occupying the screen size? Clearer? :) thanks – Don Draper Oct 16 '15 at 16:59
  • It's a little bit clearer but still not perfect. So you have a TableView and you want to fill the screen based on how many cells are currently filled? What I can say based on your comment is that you'll want to record a value for the number of populated cells, and then set size constraints based on device height/width. You can get device height and width: [Here](http://stackoverflow.com/questions/24110762/swift-determine-ios-screen-size) and set constraints with: [This](http://stackoverflow.com/questions/30078267/dynamically-size-table-view-cells-using-auto-layout-constraints) – Michael Fourre Oct 16 '15 at 17:08
  • You're right, that's what I'm asking - but I'm still unsure about how to implement this. Thanks! :D – Don Draper Oct 16 '15 at 19:14
  • @DonDraper It's always best to post examples of your current code even if it isn't working at the moment, because then it's much easier to give concrete solutions! – Michael Fourre Oct 16 '15 at 22:12