fun Text(verbatim: String, modifier: Modifier = Modifier)Overview
A plain String is shown as it is. Pass a LocalizedKey to look the text up in your app's string catalog and to render Markdown such as bold or links. For runs with different fonts or colors in one paragraph, build a StyledString and pass it to Text(StyledString).
Text("Hello, world")
Text(LocalizedKey("welcome.title"), modifier = Modifier.font(Font.title))This is the Kotlin form of SwiftUI Text.init(verbatim:): SwiftUI documentation. In Swift it reads:
init(verbatim content: String)Topics
Creating a Text
fun Text(verbatim: String, modifier: Modifier = Modifier)
fun Text(date: Double, style: Text.DateStyle, modifier: Modifier = Modifier)
fun Text(key: LocalizedKey, modifier: Modifier = Modifier, tableName: String? = null)
fun Text(resource: LocalizedKey, modifier: Modifier = Modifier)
Initializers
constructor()
constructor(pattern: Text.LineStyle.Pattern = Text.LineStyle.Pattern.solid, color: Color? = null)
Modifiers for Text
fun Modifier.underline(isActive: Boolean = true, color: Color? = null): Modifier
fun Modifier.strikethrough(isActive: Boolean = true, color: Color? = null): Modifier
fun Modifier.bold(): Modifier
fun Modifier.italic(): Modifier
Type properties
val layoutBased: Text.AlignmentStrategy
val writingDirectionBased: Text.AlignmentStrategy
val default: Text.AlignmentStrategy
val lowercase: Text.Case
val uppercase: Text.Case
val date: Text.DateStyle
val time: Text.DateStyle
val timer: Text.DateStyle
val offset: Text.DateStyle
val relative: Text.DateStyle
val disablesSubpixelQuantization: Text.Layout.DrawingOptions
val single: Text.LineStyle
val dashDotDot: Text.LineStyle.Pattern
val dot: Text.LineStyle.Pattern
val dash: Text.LineStyle.Pattern
val solid: Text.LineStyle.Pattern
val dashDot: Text.LineStyle.Pattern
val default: Text.Scale
val secondary: Text.Scale
val head: Text.TruncationMode
val tail: Text.TruncationMode
val middle: Text.TruncationMode
val layoutBased: Text.WritingDirectionStrategy
val contentBased: Text.WritingDirectionStrategy
val default: Text.WritingDirectionStrategy
Methods
fun advanced(n: Int): Text.Layout.CharacterIndex
Types
class AlignmentStrategy
class Case
class DateStyle
class CharacterIndex
class DrawingOptions
class TypographicBounds
class LineStyle
class Pattern
class Scale
class TruncationMode
class WritingDirectionStrategy