|
I can't seem to get past this issue, no matter how much I play with self.edgesForExtendedLayout. I can't figure out where to put it, if that is the solution. I have two problems that you can see in the image. The image of the turtle is actually starting way up underneath the Navigation Bar and the name of the turtle is for some reason over top of the turtle. There is nothing in my code, I don't think, that would make any of this happen, and most of the research snds me in the direction of edges and safe areas, but I am not eperienced enough to figure it out.
|
|
This is actually a pretty cool example of how SwiftUI lays out and draws its views. The culprit actually is in your code, it's the The Explanation
The issue is, that the
The SolutionsSo, how do we fix this? The easiest fix is to just remove the
The other alternative, and probably what you want, is to add a
Hope that helped :) |
|
That was awesome, and expalined so much of what was going wrong for me. If there any way to know how much of the image view is under the navbar and just, say, pad it down? What I really want to do set the size of a view and have a photo, portrait or landscape, fill that view and crop out the rest. I have that now, it's just positioned incorrectly, or at least not where I want it. Clipped, does that, kind of. But the center point of the photo is too high and the photo getes clipped off center. |
|
If the image is offset from the centre then applying an offset before the .clipped statement may help
|
|
SPONSORED Emerge helps iOS devs write better, smaller apps by profiling binary size on each pull request and surfacing insights and suggestions. Companies using Emerge have reduced the size of their apps by up to 50% in just the first day. Built by a team with years of experience reducing app size at Airbnb.
Sponsor Hacking with Swift and reach the world's largest Swift community!
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.