android:imageincircle
imageincircle
차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
android:imageincircle [2025/06/09 21:22] – 만듦 이거니맨 | android:imageincircle [2025/06/09 22:36] (현재) – icon in the circle 이거니맨 | ||
---|---|---|---|
줄 1: | 줄 1: | ||
+ | ===== 1. Image in the card ===== | ||
+ | |||
The snippet of image in circle is like this | The snippet of image in circle is like this | ||
줄 15: | 줄 17: | ||
} | } | ||
Text(text = " | Text(text = " | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== 2. Icon in the Circle ===== | ||
+ | |||
+ | By making a circle by Surface compose, you can align center the icon | ||
+ | |||
+ | <code kotlin> | ||
+ | // Icon in the center of Circcle | ||
+ | @Composable | ||
+ | fun CircleWithIcon(iconColor: | ||
+ | val circleSize = 36.dp | ||
+ | val iconSize = 32.dp | ||
+ | |||
+ | Surface( | ||
+ | modifier = Modifier.size(circleSize), | ||
+ | shape = CircleShape, | ||
+ | color = MaterialTheme.colorScheme.secondary | ||
+ | ) { | ||
+ | Box( | ||
+ | modifier = Modifier.fillMaxSize(), | ||
+ | contentAlignment = Alignment.Center | ||
+ | ) { | ||
+ | Icon( | ||
+ | painter = icon, | ||
+ | contentDescription = description, | ||
+ | modifier = Modifier.size(iconSize), | ||
+ | tint = iconColor | ||
+ | ) | ||
+ | } | ||
+ | } | ||
+ | } | ||
</ | </ |
android/imageincircle.1749471734.txt.gz · 마지막으로 수정됨: 저자 이거니맨