Maik
12/03/2020, 12:54 PM@Composable
fun Greeting() {
Box(
modifier = Modifier.height(250.dp)
) {
Box(
modifier = Modifier
.align(Alignment.TopCenter)
.size(100.dp)
.border(3.dp, Color.Cyan)
)
Box(
modifier = Modifier
.align(Alignment.BottomCenter)
.size(100.dp)
.border(3.dp, Color.Cyan, GenericShape { size ->
moveTo(0f, 0f)
lineTo(size.width, 0f)
})
)
}
}
As you can see in the screenshot, the border is drawn, but it does not have the right width and also not the right color.
Maybe someone can explain me where my mistake is or how I can draw a corresponding border at the top edge.
I used the current version of Compose and Kotlin.Rafs
12/03/2020, 1:08 PMNader Jawad
12/03/2020, 7:27 PMModifier.drawWithContent
to draw the content first then draw the top border line on top of the content