I am using the following code to move UIImageView that exists inside a UIView. } I would like to do this so that UIView could not exit the parent view. In the minute the view of the image is able to go full screen. Get the first new frame of your Make sure that you pass UIImageView and check whether it's your superView Inside the
CGRectContainsRect () method is using. If so, set the
UImageView's frame to a new frame.
- (IBAction) Handlain: (UIPanGestureRecognizer *) Identifier {CGPoint Translation = [Identifier Translation Inview: self.view]; CGRect identifierframe = identifier View.frame; RecognizerFrame.origin.x + = translation.x; Identifier fram.origin.i + = translate Y; // Check that if UIImageView is completely inside your supervision (CGRCTinstance (self view, Bound, IdentifierFrame)) {identizer.view.frame = Identifier frame; } // Check otherwise if the UIImageView is horizontally outside of Vertical and / or its // Superview, if so, then set the Frame for UImageView accordingly. // It is necessary that when the user hovers faster it provides a smooth translation. Else {// Check pending (identifier frame.organ.A.self.view.bounds.origin.y) {identizerFrame.origin.y = 0; } And if (recognizerFrame.origin.y + identifier frame.ize.height> self.view.bounds.size.height) {identizerFrame.origin.y = self.view.bounds.size.height - recognizerFrame.size. Height; } // horizantally check if (identifierFrame.origin.x
bound superView and
frame to
UIImageView so that both
CGRTX is in the same coordinate system.
No comments:
Post a Comment