Move ImageView around inside RelativeLayout

前端 未结 4 467
孤城傲影
孤城傲影 2020-12-10 17:00

I need to move an ImageView (or anything else, for that matter) around inside a RelativeLayout. Does any one know the proper way to do this?

4条回答
  •  失恋的感觉
    2020-12-10 17:11

    It is very easy. You can implement onTouchListener event of any control you want and set its x, y position like make a new LayoutParams set its x, y and assign to view as view.setLayoutParam(layoutParams); it will drag the View.

提交回复
热议问题