SwiftUI的Text类型有一个修饰符,如果文本太长,无法在容器中横向容纳,则允许文本包装。Therefore, it should wrap to fit, and it does.") .lineLimit(nil)
除了在SwiftUI NavigationButton我在NavigationButton实例中</
由于List目前看起来不像它的可配置的移除行分隔符,所以我使用一个带有VStack的ScrollView来创建文本元素的垂直布局。Duis tristique eros eget ex consectetur laoreet.") }.frame(width: UIScreen.main.bounds.width)生成的Text呈现为截短单行。在ScrollView之外,它呈现
即使在设置.lineLimit(nil)之后,文本也不会被包装。var body: some View { Text("SwiftUI is a modern way to declareinterfaces for any Apple platform. ") .color(.red)
.lineLimit</em