views:

64

answers:

0

I have an ImageView sitting on a FrameLayout. I want to be able to move this imageView by setting a margin:
LayoutParams lp = new FrameLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT);
lp.setMargins(left, top, 0, 0);
imageView.setLayoutParams(lp);
imageView.invalidate();
However nothing changes and my imageView does not move.
What am I doing wrong?
Do I need to be doing something different other than imageView.invalidate() after I set new margins?