iOS 15: Resizing images to fit the screen using GeometryReader – Moonshot SwiftUI Tutorial 1/11

iOS 15: Resizing images to fit the screen using GeometryReader – Moonshot SwiftUI Tutorial 1/11

Paul Hudson

2 года назад

8,342 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@SOME_WORDS
@SOME_WORDS - 23.08.2023 00:31

You can not stretch the georeader over the entire page code, but put a transparent rectangle as the bottom layer and use the georeader to measure only its dimensions. Transfer these dimensions to 2 @State variables (width and height), and then use them as reference units when building the page.
And in order to maintain dimensions when the device orientation changes, compare the screen height with the width and if-th exchange the values ​​of these variables.

Ответить
@ebsm93
@ebsm93 - 13.08.2023 03:40

there should be quicker way of centering an image via geometry reader with less code

Ответить
@devlanderjs
@devlanderjs - 16.05.2023 21:20

Well made 👏

Ответить
@CallofDutyMobileGlitching
@CallofDutyMobileGlitching - 29.04.2022 15:21

How can I an image fill the whole screen then subtract the width by about 25 to give it a little room and make it look like that for every iPhone

Ответить
@eliudiaz7469
@eliudiaz7469 - 25.11.2021 21:36

Always saving me with these tutorials!
Much appreciated.

Ответить
@MaximKhatskevich
@MaximKhatskevich - 14.11.2021 13:39

Thanks a lot for clear explanation all the tricky subtle aspects AND for a great little tip at the end that we can apply frame more than once to achieve interesting outcomes!

Ответить
@petersalmon9173
@petersalmon9173 - 08.11.2021 07:10

Thanks for these great tutorials!

Ответить