Site icon AndroidRide

Jetpack Compose Simple Stroke Bold Text Label Example

In this post, you’ll learn how to create beautifully outlined text in Jetpack Compose using the `drawStyle` parameter. It’s a simple technique that can make your text stand out!

This is how the final output will look!


drawStyle = Stroke(width = 1.5f)


 Box {
                            Text(
                                text = "ANDROID",
                                style = TextStyle(
                                    fontSize = 92.sp,
                                    fontWeight = FontWeight.Bold,
                                    color = Color.Blue,
                                    drawStyle = Stroke(width = 8f)
                                )
                            )
                            Text(
                                text = "ANDROID",
                                style = TextStyle(
                                    fontSize = 92.sp,
                                    fontWeight = FontWeight.Bold,
                                    color = Color.White,
                                    drawStyle = Fill
                                )
                            )
                        }

Thats all for today.

Exit mobile version