Metin düzenini yapılandırın
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Bu sayfada, maxLines
ve overflow
gibi parametrelerle metin düzeninizi nasıl yapılandıracağınız açıklanmaktadır.
Görünür satırları sınırlama
Text
composable'da görünür satır sayısını sınırlamak için maxLines
parametresini ayarlayın:
@Composable
fun LongText() {
Text("hello ".repeat(50), maxLines = 2)
}
Metin taşmasını belirtme
Uzun bir metni sınırlarken TextOverflow
karakterini kullanmak isteyebilirsiniz. Bu karakter yalnızca görüntülenen metin kısaltılmışsa gösterilir. Bunu yapmak için textOverflow
parametresini ayarlayın:
@Composable
fun OverflowedText() {
Text("Hello Compose ".repeat(50), maxLines = 2, overflow = TextOverflow.Ellipsis)
}
Sizin için önerilenler
Bu sayfadaki içerik ve kod örnekleri, İçerik Lisansı sayfasında açıklanan lisanslara tabidir. Java ve OpenJDK, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-09-03 UTC.
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2025-09-03 UTC."],[],[],null,["This page describes how to configure your text layout with parameters like\n`maxLines` and `overflow`.\n\nLimit visible lines\n\nTo limit the number of visible lines in a `Text` composable, set the `maxLines`\nparameter:\n\n\n```kotlin\n@Composable\nfun LongText() {\n Text(\"hello \".repeat(50), maxLines = 2)\n}https://github.com/android/snippets/blob/6301d76e6d8858451ce7ccc28f0bbb2ad06def37/compose/snippets/src/main/java/com/example/compose/snippets/text/TextSnippets.kt#L279-L282\n```\n\n\u003cbr /\u003e\n\nIndicate text overflow\n\nWhen limiting a long text, you may want to indicate a [`TextOverflow`](/reference/kotlin/androidx/compose/ui/text/style/TextOverflow),\nwhich is only shown if the displayed text is truncated. To do so, set the\n`textOverflow` parameter:\n\n\n```kotlin\n@Composable\nfun OverflowedText() {\n Text(\"Hello Compose \".repeat(50), maxLines = 2, overflow = TextOverflow.Ellipsis)\n}https://github.com/android/snippets/blob/6301d76e6d8858451ce7ccc28f0bbb2ad06def37/compose/snippets/src/main/java/com/example/compose/snippets/text/TextSnippets.kt#L288-L291\n```\n\n\u003cbr /\u003e\n\nRecommended for you\n\n- Note: link text is displayed when JavaScript is off\n- [Graphics in Compose](/develop/ui/compose/graphics/draw/overview)\n- [Style paragraph](/develop/ui/compose/text/style-paragraph)\n- [Work with fonts](/develop/ui/compose/text/fonts)"]]