Reputation: 11890
I have implemented a custom ImageView that can be dragged around when housed in a RelativeLayout. Essnetially, I change the leftMargin and topMargin of the layout parameters as the view is being dragged.
This mostly works as expected. I can drag the view around. Even negative values for the margin work fine. The view can be dragged outside the left edge as well as the top edge.
The problem is I am not able to drag the view outside of right edge or the bottom edge. In fact, the view starts to shrink as I try to drag it outside any of these two edges.
I played with "clipChidren" as well as "clipToPadding" parameters on the RelativeLayout but that wasn't of any help.
I would appreciate it if someone can guide me on how to display a partial view at the right edge or the bottom edge. Thank you in advance for your help.
Upvotes: 1
Views: 1599
Reputation: 7698
This problem can be resolved if you change the rightMargin
and bottomMargin
as well when dragging. When you change all four margins, you will get the desired behaviour.
Upvotes: 1