Search code examples
androiddynamicruntimeandroid-relativelayout

How to dynamically set position of widget in RelaltiveLayout?


I am using RelativeLayout with Imageview and few buttons.

I am dynamically changing the size of the ImageView according to the size of the screen (usingDisplay class). The problem is that one of the button's location refers to the Imageview.

How do I dynamically change its location according to the new size of the Imageview?


Solution

  • try calling requestLayout() when you updated the imageView.