GO FURTHER, FASTER: Try the Swift Career Accelerator today! >>

ScrollView in SwiftUI 2 overwriting Safe Area?

Forums > SwiftUI

I've just built one of Paul's examples (SwiftUI by Example - How to add horizontal and vertical scrolling using ScrollView) where he writes "... because it automatically sizes itself to ft the content we place inside it and also automatically adds extra insets to avoid the safe area"

I've run it on my iPhone SE 1st gen (iOS 14) and the rectangles go under the status bar (which may not be a safe area?).

I then ran it on the iPhone 11 Simulator and they clearly go over the safe area (the notch, time and battery). Is this a change in SwiftUI 2 a bug that I should report to Apple?!

3      

If you think it an unexpected behaviour then use the Feedback app on your device to report it.

3      

I'm not sure if it's unexpected!

If I add a NavigationView() then it behaves. Maybe that is how it's meant to be used.

3      

Go further, faster with the Swift Career Accelerator.

GO FURTHER, FASTER Unleash your full potential as a Swift developer with the all-new Swift Career Accelerator: the most comprehensive, career-transforming learning resource ever created for iOS development. Whether you’re just starting out, looking to land your first job, or aiming to become a lead developer, this program offers everything you need to level up – from mastering Swift’s latest features to conquering interview questions and building robust portfolios.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

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.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.