How do I programmatically remove an existing rule that was defined in XML?
You can’t remove a rule because all rules are always stored in a fixed-size java array. But you can set a rule to 0. For example layoutParams.addRule(RelativeLayout.RIGHT_OF, 0); layoutParams.addRule(RelativeLayout.BELOW, R.id.new_ref_LinearLayout); EDIT (thanks to Roger Rapid): As of API level 17, the class RelativeLayout.LayoutParams has the following method: public void removeRule(int verb) So you can remove … Read more