Text inside a VStack truncates when it's not supposed to in SwiftUI

后端 未结 3 1398
星月不相逢
星月不相逢 2021-01-01 19:29

I\'m trying to create a simple stack of Text inside a VStack, and no matter what I do, the text will truncate instead of wrap, even if I explicitly

3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-01 20:02

    I figured out how to get the text to render properly.

    Applying the answer here works: Views compressed by other views in SwiftUI VStack and List

    The key is to ensure that the .fixedSize() gets added before .frame()

    No Spacer() needed!

提交回复
热议问题