I have an imageview in a view and I want the user to be able to move it but I am not noticing an event to catch this.
Imageview only has Open and Close what should be the approach?
Part 2 I want to use a png image so I can use the transparency but I can’t seem to load it into the imageview, will an imageview only load jpegs from the project?
The only control that has PointerDown is iOSCanvas.
Place the ImageView on top of a Canvas and make sure it is child (the canvas has a red outline). Then the canvas will trigger PointerDown for you.
BTW I just filed a feature request to have all controls support PointerDown, PointerUp and PointerDrag, like Desktop has been supporting since the very early days or RS.
In the Pointerup event I put ImageView2.Top = pos.Y ImageView2.left = pos.X but it says I cannot assign a value to this property, so how to you allocate the new position?
Dim left As New iOSLayoutConstraint(LeftConstraintImageview2, _
iOSLayoutConstraint.AttributeTypes.Left, _
iOSLayoutConstraint.RelationTypes.Equal, _
Self, iOSLayoutConstraint.AttributeTypes.Left, _
1.0, pos.X)
Declare sub addGestureRecognizer lib “UIKit” selector “addGestureRecognizer:” (ctrl as ptr, recognizer as ptr)
//recognizer1 is a UITapGestureRecognizer dragged onto the view
//imageView1 is an iOSImageView dragged onto the view
addGestureRecognizer(ImageView2.handle, recognizer1)
Where did you put that code? It should work like you have it. Is it possible the image view is the wrong name since you have a discrepancy between your comment and code?
This is a fairly old example which I made about a year ago but it still works. The modules from the example are all a part of iOSKit so you can ignore them if you copy the view into your project.
Until the scope of what you need changes and suddenly you need more advanced gesture recognition than is available in the canvas. Then you can write it yourself or use the declares classes.
Indeed. But given the OP difficulties of implementation, more complex may not be better. His original questions was simply PointerDown. Sometimes it is best to have something that works right away.