I called mine “Example”, but obviously you should substitute your image name in the code below. ![]() It doesn’t matter what it is, as long as it’s wider than the screen. With the press of a few keyboard buttons, you can reconfigure the size of apps on your screen to any dimensions you want, giving you even more control over how your apps appear than Windows 10s. This is sometimes what you want, but mostly you’ll want to show the image at a lower size, and I want to show you how that can be done, but also how we can make an image fit some amount of the user’s screen width using a new view type called GeometryReader.įirst, add some sort of image to your project. So, if the picture is 1000x500, the Image view will also be 1000x500. ![]() When we create an Image view in SwiftUI, it will automatically size itself according to the dimensions of its contents.
0 Comments
Leave a Reply. |