I am trying to dynamically resize an image which is in the relative layout using the code
int height = v.getHeight();
int width = v.getWidth();
height += 50;
width += 50;
RelativeLayout.LayoutParams layout = new RelativeLayout.LayoutParams(height, width);
layout.setMargins(200, 200, 200, 200);
layout.addRule(RelativeLayout.CENTER_IN_PARENT);
v.setLayoutParams(layout);
Here v is a view (a imageView in this case) The rule works perfectly. The image gets placed in the center but what i want to get is the image should be placed where it is. That is if the image is at the location (100,100) it's size should be increased and the image should be placed at the same location or the location where i need to place it. Can anyone suggest me please.