title: How do I arrange SwiftUI Toolbar items?
body: <p>I have a SwiftUI ToolBar with 4 buttons, however the code I implemented is not correct because the buttons end up in weird places when changing the device type in simulator.</p>
  <p>Even worse, when viewed on iPhone 8 / 8 Plus, 2 of the buttons are on the far edges of the window.</p>
  <p>How do I properly apply spacing/padding to ToolBar buttons so they are consistent across different iOS devices?</p>
  <p>Thank you!</p>
  <p><a href="https://i.stack.imgur.com/Jzf11.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Jzf11.png" alt="IPhone 8" /></a></p>
  <pre><code> // This code spaces the buttons but they change positions depending on the iOS device
  
  
                   ToolbarItem {
                          HStack {
                              HStack {
                                  ProfileUploadMediaButton()
                              }.padding([.trailing], 85)
                              HStack {
                                  ProfileUsernameButton()
                              }.padding([.trailing], 84)
                              HStack {
                                  ProfileLiveButton()
                              }.padding([.trailing], 6)
                              HStack {
                                  AccountButton()
                              }.padding([.trailing], 12)
                          }
                      }
                  })
  
  </code></pre>
  <p><a href="https://i.stack.imgur.com/WnIun.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WnIun.png" alt="IPhone Pro Max" /></a></p>
  <pre><code>// I was thinking code like this but all buttons are bunched together on the right-side of  // the screen...
  
                      ToolbarItem {
                          HStack {
                              ProfileUploadMediaButton()
                              ProfileUsernameButton()
                              ProfileLiveButton()
                              AccountButton()
                          }
                      }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/8bvsg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8bvsg.png" alt="Items are all bunched together" /></a></p>