Jetpack Compose Text

    [Compose Text] Text에 max line 설정하기 : maxLines

    maxLines란? maxLines란 Text의 줄이 최대 몇 줄까지만 가능한지를 설정하는 옵션이다. maxLines: Int = Int.MAX_VALUE maxLines의 기본값은 Int의 최대값으로 설정되어 있어 Text는 무제한으로 Line을 가질 수 있다. maxLines은 그 자체로도 많이 쓰이고, TextOverFlow.Ellipsis 등과도 함께 쓰이니 어떻게 사용하는지 잘 알아두도록 하자. Default 값에서의 동작 실습을 위해 같은 3줄짜리 text를 가진 Text 컴포저블을 생성하자. maxLines에 아무 값도 설정하지 않으면 maxLines = Int.MAX_VALUE가 되므로 3줄이 모두 보이게 된다. @Preview(showBackground = true, widthDp = 1..

    [Compose Text] Text Composable의 프로퍼티에 대해 알아보자

    Compose Text 스타일링의 구성 Compose의 Text는 다음 14가지의 속성을 설정할 수 있다. @Composable fun Text( text: String, modifier: Modifier = Modifier, color: Color = Color.Unspecified, fontSize: TextUnit = TextUnit.Unspecified, fontStyle: FontStyle? = null, fontWeight: FontWeight? = null, fontFamily: FontFamily? = null, letterSpacing: TextUnit = TextUnit.Unspecified, textDecoration: TextDecoration? = null, textAlign: T..