text 두줄안되게

개배박발불지은만자·2024년 8월 23일
0
Text(
    text = "$date",
    style = MaterialTheme.typography.displaySmall.copy(color = color),
    modifier = Modifier.sharedElement(
      state = rememberSharedContentState(key = "date.id${dateId}"),
      animatedVisibilityScope = animatedVisibilityScope
    ) // sharedElement
  ) // text

하면 20 인 경우 2 하고 0 이 다움즐에 나오는 버그가 생긴다.
그럴 때softWrap = false를 사용하면 2줄로 넘어 가는 문제를 방지 할 수 있다.
softWrap는 기본값이 true 이다.

Text(
    text = "$date",
    style = MaterialTheme.typography.displaySmall.copy(color = color),
    modifier = Modifier.sharedElement(
      state = rememberSharedContentState(key = "date.id${dateId}"),
      animatedVisibilityScope = animatedVisibilityScope
    )// sharedElement
    .softWrap = false
  ) // text

0개의 댓글