目前正在调查Litho
,我试图为Column
. 在我将背景添加到Column
. Column
似乎没有被剪裁到边框
请参阅附图以获得更好的描述
代码(在 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()
}
附加问题:shadowElevation
似乎没有工作以及没有阴影显示。
请问如何解决边框(和阴影)问题?