Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I have a two imageView in a Relative Layout. Is it possible to change the Position of one imageview dynamically. while the other remain constant.?
- ImageView img1=(ImageView) findViewById(R.id.imageview);
- ImageView img2=(ImageView) findViewById(R.id.imageview);
- RelativeLayout.LayoutParams lp2=new RelativeLayout.LayoutParams(100, 100);
- lp2.addRule(RelativeLayout.ALIGN_RIGHT,img2.getId());
- img1.setLayoutParams(lp2);
- lp2.setMargins(Left, TOp, right,Bottom);
- RelativeLayout.LayoutParams params = imageView2.getLayoutParams();
- params.addRule(RelativeLayout.CENTER_IN_PARENT);
- imageView2.setLayoutParams(params);
Advertisement
Add Comment
Please, Sign In to add comment