framelayout - how to change android : layout_centerHorizontal = "true" to "false" at runtime -
i know how change layout_centerhorizontal of framelayout dynamically .
<framelayout android:id="@+id/myframelayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_centerhorizontal="true" > </framelayout>
use following sample code change attribute for view in relativelayout,
relativelayout.layoutparams params = (layoutparams) myframelayout.getlayoutparams();//get old parameters params.addrule(relativelayout.center_horizontal, 0);//change parameter myframelayout.setlayoutparams(params);//set new parameters