0

I tried many ways to show texts, (textfields) with variable width like this. First will each line, and let grow vertically. How in SwiftUI?

enter image description here

János
  • 32,867
  • 38
  • 193
  • 353
  • 1
    Nothing built in you have to create your own with `SwiftUI.Layout` or `HStack`s – lorem ipsum Jun 02 '23 at 12:46
  • Can you draft the basic how? – János Jun 02 '23 at 12:59
  • No, people ask this question once a week, search for Hashtag, wrapping Text, wrapping HStack, the simplest I saw was from Asperi a long time ago It is like 20-30 lines of code. There are so many solutions out there already. I would likely recreate with `Layout` if I needed one it shouldn't take much code since all the math is provided. Maybe someone else will be willing. – lorem ipsum Jun 02 '23 at 13:03
  • Do you have link to Asperi's solution? – János Jun 02 '23 at 13:39
  • I can't find Asperi's solution right away, but if you search "SwiftUI Flow Layout" on your favorite search engine, you will find multiple solutions. – jnpdx Jun 02 '23 at 14:05
  • 1
    https://stackoverflow.com/questions/58842453/swiftui-hstack-with-wrap – lorem ipsum Jun 02 '23 at 14:09

0 Answers0