How do I programmatically remove an existing rule that was defined in XML?
问题 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 want to change the relative position of the layout during the onCreate of the activity so I need to modify the "to the right of" param to relate to another layout. I tryed this: RelativeLayout.LayoutParams layoutParams; layoutParams = (RelativeLayout.LayoutParams) linearLayoutToMove .getLayoutParams(); layoutParams.addRule