Currently investigating Litho
and I tried to add a border to a Column
. It seems to work fine until I add a background to the Column
. The Column
doesn't appear to be clipped to the borders
See attached image for better description
Code (In Kotlin)
companion object {
@JvmStatic
@OnCreateLayout
fun onCreateLayout(context: ComponentContext): Component = Row.create(context)
.alignItems(YogaAlign.CENTER)
.justifyContent(YogaJustify.CENTER)
.child(
Column.create(context)
.border(
Border.create(context)
.color(YogaEdge.ALL, Color.RED)
.widthDip(YogaEdge.ALL, 2f)
.radiusDip(20f)
.build()
)
.shadowElevationDip(10f)
.backgroundColor(Color.BLUE)
.paddingDip(YogaEdge.ALL, 20f)
.child(
Text.create(context)
.text("Litho for Android")
.textSizeSp(20f)
.marginDip(YogaEdge.BOTTOM, 4f)
)
.child(
Text.create(context)
.text("20 Sections")
.textSizeSp(14f)
)
)
.build()
}
ADDITIONAL ISSUE: The shadowElevation
doesn't seem to work as well as there is no shadow showing.
Please how can I fix the border (and shadow) issues?