changing the position of ImageView dynamically in android
问题 all I need to change the position of a ImageView dynamically and iam using the following code int x=100,y=100; RelativeLayout.LayoutParams mparam = new RelativeLayout.LayoutParams((int)(LayoutParams.FILL_PARENT),(int)(LayoutParams.FILL_PARENT)); mparam.topMargin=x; mparam.leftMargin=y; ball.setLayoutParams(mparam); x+=100; y+=100; but i didnt get any change. Is it possible? and How? 回答1: You can call setPadding on your View. So, in your code (which by the way you should put in a code block!),