Home > front end >  How to make a view scrollable with only one element like in the settings app?
How to make a view scrollable with only one element like in the settings app?

Time:01-16

I want my app to have a view that can scroll even when there isn't always content to scroll to. For instance, the Wifi tab in settings is always scrollable. Is this a UIScrollView? I'm using Storyboard, not SwiftUI by the way. Thanks in advance for any suggestions!

I've tried using a UIScrollView but I think what I'm trying to achieve is different.

CodePudding user response:

I think you're looking for the UIScrollView's alwaysBounceVertical property:

If the value of this property is true and bounces is true, the scroll view allows vertical dragging even if the content is smaller than the bounds of the scroll view. The default value is false.

CodePudding user response:

The Settings app is using UITableView in "group" mode for most screens. The little bit of scrolling you can do even when there is little content is referred to as "bounce".

UIScrollView can also be used (UITableView extends UIScrollView). The bounce actually comes from the scroll view. You can enable the bounces property.

  • Related