Table View Controller with Scroll View

I have a table view controller with static cells, and I need to add a scroll view. It is a fairly simple table, but the cells are static (custom with images and text fields), so I need to start with the UITable View Controller (I believe)... All instructions I find in guides and videos (etc.!) are for more complex scenarios. Can someone help this neophyte who is trying to land this app plane in the near future? (Thanks!)

Where / why do you want to add a scroll view ?


- the table view scrolls automatically

Unless you want to add a scroll view inside the table view ????

Thanks for answering, Claude31, and for asking the question!


In the simulator, the TableViewController did not scroll all the way down through the static cells, and I assumed that was the issue. (Now I know why I couldn't find any instructions specific to these two elements together!)


Is it normal that the simulator would not scroll, or am I missing something else? I have no warnings or errors at this stage...


Thanks again.

Have you declared the number of cells ?


this is done by :


override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
     return theComputedNumberOfCells
}

Yes, I have declared number of sections (1) and rows (9), and each cell has a reuse identifier... The simulated size of the view controller is Freeform with the height specified. The scrolling bar appears briefly when the view is loaded from the initial view, but then disappears, not to be seen again.


Thanks for the help so far and any direction you can give now!

There are two main possibilities:

1. You were messing around in Interface Builder and accidentally turned off the scroll bar visibility. This isn't terribly likely, since you say the scrollbars are briefly visible.


2. Your layout of the table view isn't correct, and its extending beyond the bottom of the window. In other words, you're not seeing a scroll bar because the table view is big enough that it's not needed. The scroll bar showing up briefly and then disappearing would be a sign that your view hierarchy went through a layout update cycle.


So how are you constructing this UITableView and how it is getting displayed? Probably more important, what are you displaying it in?

This may sound too silly, but I was also surprised by this behavior of the scrollbar appearing briefly, then disappearing, both in my table and in a textfield on the next screen. The fix was for me to understand that the table and the textfield scrolled fine anyway. %^)

I'm constructing the UITableViewController in XCode IB. I'm using a TableViewController (as opposed to a TableView) because the cells are static/custom. Yes, the cells extend beyond the visibility of the initial view - so the scroll bar is needed, but there is no data source needed either, just UI elements and simple segues in each cell/row.


I'll check on the scroll bar visibility (where would I would I have done that?)... Thanks!

Hi Lucycloudwatch - It doesn't sound too silly - I wondered if that might be the case, but being a newbie, I don't have much confidence or faith that it isn't an error that I have made somewhere in this wonderful world of developing!

Hi Katy, I can only assume it's not a bug, it's a feature in the iOS universe -- the bar goes away, but scrolling is fine anyway. Someone else know more?

The "normal" way to scroll is by dragging the view. Scroll bar is there for additional convenience (if you want to scroll rapidly to the bottom for instance). But it overlaps the content, so it disappears rapidly if you do not hit it and move.


I personnaly find it a bit tricky to use.

The phenomenon I'm experiencing is that both the scroll bar and the scroll capability disappears (not sure if the capability was ever there - just a fleeting glimpse of the scroll bar). Any further thoughts?

WOuld you accept to share the code of your tableViewController ?

Table View Controller with Scroll View
 
 
Q