|
I'm working on a settings page for an app, and one of the things that I'm looking to do is have a table with a couple of selectable options, some intro text explaining everything at the top, and some additional controls beneath. Understandng that different screen heights can cause some items to be clipped, I'm trying to put all of this into a Here's the code for my view controller with the embedded
What I'm currently seeing is that Horizontal scrolling is frozen out completely. Good. When I try to scroll vertically, however, is where it gets weird. The content itself doesn't move. The vertical scroll bar, however, starts at the screen height and continues to shrink more and more as I endlessly scroll down. The console output shows that the Y index is being remembered and keeps going up well into the tens of thousands if I keep going—yet the content itself never actually gets scrolled. It's as if it thinks the view is ever-growing, and the visible part of the screen merely represents a smaller proportion of the content. Before I froze out the horizontal scrolling it had no qualms about auto-updating the view and showing things sliding left and right (indeed, it wouldn't scroll vertically at all, near as I could tell). As such, especially since the console shows that Does anyone have any insights into how to get it to scroll vertically, and to be aware of the vertical content size so that it doesn't act like it can scroll infinitely (as is the current behavior)? Thanks! |
|
Hi. I don't understand why are you combining |
|
Hi, Filip! The reason why I'm not using the scroll view that comes with the 1) The table view isn't the entire view—I've got material I want to put above and below it. Kind of like how in a lot of the pages of the Settings app you'll see sections of table view cells broken up by other content. 2) I've been meaning to figure out how to actually set up and use If it'll help with envisioning the scenario, replace the table view with a really tall image view. Still need it to scroll down to see the rest of the content. |
|
In that case, I think you should use table view header and footer views (not section headers, but header for whole table view). Or in any case you can always have multiple types of cells... The Settings in iOS is almost surely just TableView or CollectionView. I would really build the screen entirely out of these two components, it is standard approach and what you learn can be then used elsewhere. |
SPONSORED AppSweep by Guardsquare helps developers automate the mobile app security testing process with fast, free scans. By using AppSweep’s actionable recommendations, developers can improve the security posture of their apps in accordance with security standards like OWASP.
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.