I have a UIImageView that I am trying to use to use a UIPanGestureRecognizer object UIImageView is located at the top of a UITableView , And works as a scrollbar. I should take this UIImageView user up or down UITableView, not sideways. To accomplish this, I have implemented the UIGestureRecognizerDelegate, and I have the following methods:
- (BOOL) Gesture Recipient: (UIGestureRecognizer *) The gesture-promoter should be identified with synonymsjesterer : (UIGestureRecognizer *) Other GestureRecognizer {return yes; } - (Zero) Pigestation detected: (UIPNestiocessor *) Identifier {NSLog (@ "What are I called?"); // _ startLocation is a property CGPoint type that I declared in the .h file _startLocation = [identifier location InView: _imageView]; NSLog (@ "dot:% d", _start location); CGRect frame = [_imageView frame]; Frame.origin.y + = frame.origin.y - _startLocation.y; [_imageView setframe: frame]; _imageView.center = _start location; } method, pangestructured code is called from viewDidLoad as follows: UIPanGestureRecognizer * PanGesture = [[UIPanGestureRecognizer alloc] initWithTarget: Proceedings manually: @Selector (Pan Gesture Detected :)); Pangestier.mxiamannofoutches = 1; PanGesture.minimumOfTouches = 1; PanGesture.delegate = self; [_GadgetRiver: Pangestier]; Unfortunately, when I try to move it, my UIImage screens go madly all over the place. I want to see a smooth scroll UIImageView go up / down, while The user leaves it. Can anyone see what I am doing?
Just place this row in your handler and delete all others. _imageView.center.y = [Identifier Location Inview: [_viewview supervision]]. Y; You need to get a place in the review, not the image itself and just replace the center's y value.
No comments:
Post a Comment