반응형
여러가지 Box Style
@Preview(showBackground = true)
@Composable
private fun BoxSample() {
Row(modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.spacedBy(4.dp)) {
Box(
modifier = Modifier
.clip(CircleShape)
.background(Color.Red)
.size(44.dp)
)
Box(
modifier = Modifier
.size(44.dp)
.clip(RoundedCornerShape(12.dp))
.background(Color.Blue)
.clickable { /*TODO Click*/ },
contentAlignment = Alignment.Center,
) {
Text(text = "Hello 1", color = Color.White)
}
Box(
modifier = Modifier
.size(44.dp)
.clip(RoundedCornerShape(topStart = 12.dp))
.clip(CutCornerShape(bottomEnd = 12.dp))
.background(Color.Gray)
.clickable { /*TODO Click*/ },
contentAlignment = Alignment.Center,
) {
Text(text = "Hello 2")
}
}
}
반응형
'Android' 카테고리의 다른 글
Android ANR / Canvas / 메모리 초과 해결방법 (0) | 2024.08.28 |
---|---|
Android Coroutine example 코루틴 권장사항 (0) | 2024.07.04 |
RoomDatabase Hilt Error -> AppDatabase. AppDatabase_Impl does not exist at androidx.room.Room.getGeneratedImplementation(Room.kt:58) .. (0) | 2024.04.14 |
RecyclerView 하단 divider 깜빡임 | RecyclerView bottom divider blinking (0) | 2024.03.26 |
Android constraint layout id 중복으로 사용하기 (0) | 2024.02.27 |
댓글