How to create attractive text views with fonts, color, line spacing, and more
How to create attractive TextView in swift UI?
Definition:
Swift UI is a new programming language designed and developed by apple. In this blog, I'll teach you how to create a basic to advance app using SwiftUI. And also, we'll cover some of its features.
Lets get it to the Blog 💁.
Basic Text View:
A TextView in SwiftUI displays the text to the end users and the developers, they don't have any limits to modify the TextView. let's see below!
By default, Text View has a "Body" Dynamic style but you can select from other sizes and weights by calling .font() post the text.
VStack
Text("LargeTitle")
.font(.largeTitle)
Text("Title")
.font(.title)
Text("Title2")
.font(.title2)
Text("Title3")
.font(.title3)
Text("Headline")
.font(.headline)
Text("Sub Headline")
.font(.subheadline)
Text("Body")
.font(.body)
Text("Callout")
.font(.callout)
Text("Caption")
.font(.caption)
Text("Footnote")
.font(.footnote)
}Font Weight:
In SwiftUI we have plenty of choices to customize the text like Ultralight, Thin, Light, Regular, Semibold, Bold, Medium, Black, and Heavy. Developers can pick the opt text for their UI..png)
.png)
Comments
Post a Comment