Skip to content Skip to sidebar Skip to footer

Animatelayoutchanges On Margin And Width/height Only Works If Another Element Is Appearing/disappearing

I set up a simple activity to try to boil down this problem. I have a FrameLayout in which I have enabled 'AnimateLayoutchanges'. I have a button which onclick changes the layout

Solution 1:

for that type of changing..like change param..you need to enable 'changing' too (animateLayoutChange must be true)

    val frmMain=findViewById<FrameLayout>(R.id.frmMain)

    val currentTransitions=frmMain.layoutTransition
    currentTransitions.enableTransitionType(LayoutTransition.CHANGING)
    frmMain.layoutTransition=currentTransitions

Post a Comment for "Animatelayoutchanges On Margin And Width/height Only Works If Another Element Is Appearing/disappearing"