|
I have the following code:
My goal is to have my LocationPickerView() take up the entire screen regardless of the orientation of the device. A LocationPickerView() is a custom view I built:
However, I have a problem. The safe area is not being ignored. At first glance, I thought this was because the frame was already set by a "constant" value from geometry. So, I thought I would flip the order of when I ignore the safe area and when I set the frame. This only resulted in a much weirder configuration. At first, the view does take up the entire screen. However, when I change the device to another orientation, the view stays the original height and width it was without updating, despite using What is happening here? I am certain this is valid behavior, but I don't understand why it is and how to fix it. I am trying to make things as simple as possible and thought I would add the frame and safe area options in my main struct, in an attempt to keep that code out of every view. This feels like an easy fix, but I can't figure it out. |
|
Probably all depends on what you have inside your Simple code like below handles everything without a hitch.
|
|
I think it has something to do with ARView. I tested your code and it does indeed work. However, it doesn't seem to work with what I have. I will look into it more, but this is kind of odd. |
|
I found a person with the same issue, but no solution: https://www.reddit.com/r/SwiftUI/comments/j5s7tn/how_to_make_arview_fullscreen_uiviewrepresentable/ |
|
|
|
@NigelGee I think my situation using |
|
|
SAVE 50% All our books and bundles are half price for Black Friday, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.
You need to create an account or log in to reply.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.