I use SwiftUI. I need a custom view. The custom view width should be equal to the superview width. The custom view contains two image views, aligning left and right respectively. Each image view has the same width and height (aspect ratio = 1). Two image views have 10 points space. I will display different size images in the image view (scale aspect fill).
If I use GeometryReader
, I can set the image view frame dynamically, but how to set the GeometryReader
frame dynamically? If I use HStack
without GeometryReader
, the image views frames are variable. How to do this in SwiftUI?