android - How to set layout_alignParentRight="false" programmatically? -
this question has answer here:
how set android:layout_alignparentright="false"
programmatically? can set true
code want set false
programmatically:
relativelayout.layoutparams params = (relativelayout.layoutparams)myview.getlayoutparams(); params.addrule(relativelayout.align_parent_right); button.setlayoutparams(params);
there method removerule(int) it's added in (api level 17). want use in api level 7 or 8.
this code set false:
addrule(relativelayout.align_parent_right,0)
Comments
Post a Comment