swiftui margin code example
Example 1: center text swiftui
.multilineTextAlignment(.center)
Example 2: swiftui padding one line
Text("Hello, World!").padding(EdgeInsets(top: 500, leading: 0, bottom: 0, trailing: 0))
Example 3: remove padding hstack swiftui
VStack(alignment: .leading) {
Text("How to enjoy your life without money").bold().font(.system(size: 20))
HStack (alignment: .center, spacing: 0, content: {
Text("Lets create")
Text("3K views")
Text("3 hours ago")
})
}
Example 4: SwiftUI padding
Text("Example")
.padding(20)
.padding(.leading, 20)
.padding(.trailing, 20)
.padding(.top, 20)
.padding(.bottom, 20)