Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

center a text in swiftui

.multilineTextAlignment(.center)
//From SwiftUI beta 3 forward, you can center a text view with the frame modifier:
Text("Centered")
    .frame(maxWidth: .infinity, alignment: .center)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #center #text #swiftui
ADD COMMENT
Topic
Name
6+7 =