I'm using an absolutelayout (I know its deprecated). I am adding imageview dynamically but I can't change its position from the top left corner of the screen.
ImageView iv = new ImageView(this);
iv.setImageResource(R.drawable.orb1);
this.addContentView(iv, new AbsoluteLayout.LayoutParams(80, 80, 200, 200));
However, this creates the image with top left at 0, 0 instead of anywhere else. If I change the last two values of Layout Params it still remains in that position.
Can someone assist? Thanks.
Edit: Using relative layout still doesn't work
ImageView iv = new ImageView(this);
iv.setImageResource(R.drawable.orb1);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(80, 80);
params.topMargin=50;
params.leftMargin=50;
this.addContentView(iv, params);