ispbox
08/08/2019, 7:48 PMView
into ViewGroup
dynamically, after it's creation, is there any way to do that shorter / with Splitties DSL?
root.addView(childView, LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT))
All samples I've seen follow one (most common) workflow of static UI. But I need to add some views dynamically.louiscad
08/08/2019, 7:50 PMapply
for the target ViewGroup
, You'll then be able to work it out as when first instantiation the view hierarchy.ispbox
08/08/2019, 7:57 PMroot.apply {
add(scrollView, lParams {
width = matchParent
height = matchParent
})
}