사용자 도구

사이트 도구


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 = "Change Profile Picture") Text(text = "Change Profile Picture")
 +</code>
 +
 +
 +===== 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: Color = MaterialTheme.colorScheme.primary, icon : Painter, description : String) {
 +    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
 +            )
 +        }
 +    }
 +}
 </code> </code>
android/imageincircle.1749471734.txt.gz · 마지막으로 수정됨: 저자 이거니맨