title: SwiftUI how to adjust different screen sizes
body: <p>I'm using SwiftUI to develop a people list page, the iPhone X screen is big enough but the titles are out of the screen in iPhone 8:</p>
  <p>iPhone X:</p>
  <p><a href="https://i.stack.imgur.com/hnXpP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hnXpP.png" alt="enter image description here" /></a></p>
  <p>However in iPhone 8 or smaller screen the &quot;Find People&quot; is too close to left and &quot;Follow All&quot; is even out of screen:</p>
  <p><a href="https://i.stack.imgur.com/Uvw8p.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Uvw8p.png" alt="enter image description here" /></a></p>
  <p>I know in UIKit autolayout will solve this very easy but I wonder what's the best way or proper way for SwiftUI to solve this, some answer saying using like <code>Spacer</code> or <code>HStack</code>, but none of them actually work.</p>
  <pre><code>var body: some View {
      NavigationView {
          List {
              ForEach(people) {person in
                  PersonView(person: person)
              }
          }.navigationBarItems(leading:
              VStack(spacing: 10) {
                  HStack(spacing: 100) {
                      Text(&quot;Find People&quot;).font(.system(size: 30)).bold()
                      Text(&quot;Follow All&quot;).foregroundColor(Color(ColorUtils.hexStringToUIColor(hex: Constants.THEME.THEME_COLOR)))
                  }
                  HStack(spacing: 20) {
                       Text(&quot;Import from: &quot;)
                       ForEach(socialIcons, id: \.self) {icon in
                           Image(icon).resizable().frame(width: 25, height: 25)
                       }
                  }
              }
          )
      }
  }
  </code></pre>