Skip to content Skip to sidebar Skip to footer

How To Set The Size And Position Of An Image?

I am trying to set the size and position of an image (image2) on the screen so that it is in the same position and size relative to the background image (image1) it is on no matter

Solution 1:

Did you put a try catch block and try to debug it ? It seems to be something returns null..


Solution 2:

I think problem is size of imageview

 RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams((image1.getWidth())/4, (image2.getHeight())/4);

maybe it return 0 so this problem is occur..try it


Post a Comment for "How To Set The Size And Position Of An Image?"