티스토리 뷰
두개의 글자 크기가 다른 Text를 row로 나란히 놔두려는데
Row (verticalAlignment = Alignment.CenterVertically){
Text(
text = calorie.toString(),
style = HabitTheme.typography.extraLargeBoldTextPurpleNormal
)
Spacer(modifier = Modifier.size(4.dp))
Text(
text = stringResource(id = R.string.home_bottom_sheet_kcal),
style = HabitTheme.typography.headTextPurpleNormal
)
}
이렇게 하니깐
묘하게 틀어진 모습....
Row (verticalAlignment = Alignment.CenterVertically){
Text(
modifier = Modifier.alignByBaseline(),
text = calorie.toString(),
style = HabitTheme.typography.extraLargeBoldTextPurpleNormal
)
Spacer(modifier = Modifier.size(4.dp))
Text(
modifier = Modifier.alignByBaseline(),
text = stringResource(id = R.string.home_bottom_sheet_kcal),
style = HabitTheme.typography.headTextPurpleNormal
)
}
글자 아래를 기준으로 두 Text 가 정렬된 모습
Text의 Modifier.alignByBaseline을 사용하면된다
'공부 > Android' 카테고리의 다른 글
[아키텍쳐] 클린아키텍쳐 적용하면서 했던 고민 메모, 좋았던점 (1) | 2023.09.26 |
---|---|
[Compose] 로그인 화면(바텀네비게이션 없어야되는화면)과 바텀 네비게이션 있어야 하는 화면 간 처리 (0) | 2023.09.22 |
[Compose] navigate, 네비게이션 바 이동시 이전 화면 모두 지우기 (0) | 2023.09.16 |
[Compose] 패딩, 배경색 순서 이슈 ^.^; (0) | 2023.09.11 |
[Wear] Health Service 정리 (0) | 2023.08.22 |