How do I programmatically remove an existing rule that was defined in XML?

前端 未结 3 1448
刺人心
刺人心 2020-12-01 07:03

I have a linear layout that is contained inside a relative layout. It is set in the XML file to be to the right of another linear layout (this works fine). In some cases I

3条回答
  •  情歌与酒
    2020-12-01 07:35

    add the following code to your existing code

    linearLayoutToMove.setLayoutParams(layoutParams)

    I think this should do the job. In case if the above line dont work, try to call linearLayoutToMove.invalidate() after the above line.

提交回复
热议问题