I couldn't find the information because it wasn't easy to find, so I finally found it by searching with "Swift UI Text Overflow". It's full of letters.
struct TestView: View {
var body: some View {
VStack{
Text("Use truncationMode to specify the Text abbreviation in SwiftUI")
.truncationMode(.tail)
.lineLimit(1)
Text("Use truncationMode to specify the Text abbreviation in SwiftUI")
.truncationMode(.head)
.lineLimit(1)
Text("Use truncationMode to specify the Text abbreviation in SwiftUI")
.truncationMode(.middle)
.lineLimit(1)
}
}
}
By setting truncationMode
in this way, you can adjust the position to make" …… ".
Recommended Posts