Thursday, 15 March 2012

ios - Rotate and Scale with auto-layout in iOS6 -


This is an issue that I am doing well now. My gesture detector "game" with new iOS6 and auto-layout is no longer working

I have created an app using the storyboard and there is a small game application on one of the tabs where the user can scale, rotate and pan a picture at the top of another image It should be within 5 pixels, 5% size, and 5 degrees I am running with automatic layout. The issue is that when the game image is rotated and scaled, the image "jumps" back to status start turns strangely and around the center O.

Rotate

Strong>

  // rotation gesture identifier response - (zero) answerstroke tester: (URTestationStoreRejector *) gestures {if (gesture .state == UIJsterArchiveer State brinjal} gesture.state ==UigesterstericizerStateChanged) { Image.transform = CGAffineTransformRotate Gesture.view.transform, gesture.rotation); } If (gesture.state == UIGestureRecognizerStateEnded) [did it self]; // Question is not important for signaling. Implant = 0; } Pinch gesture identifier - (zero) antiprofropicizer: (UIPinchGestureRecognizer *) Alert {if (gesture)   

Pinch

 .state == UIGestureRecognizerStateBegan || gesture.state == UIGestureRecognizerStateChanged) {image.transform = CFE Refined Transforms (Image Transform, Gesture Scale, Hint Scale); } If (gesture.state == UIGestureRecognizerStateEnded) [did it self]; // Not important for the questionnaire gesture.scale = 1; }   

I know that the easiest solution should be to close auto-layout , but this can cause issues in the rest of the storyboard because you're turned on in the storyboard Can not auto layout for one component, but you have to turn it off for the entire storyboard.

Can someone advise me what to do? I have read that this is a major issue and some are calling it a "bug" with the new auto-layout.

I am having trouble with this and I need some help.

If someone has any suggestions or can point me in the right direction, then it would be highly appreciated. Thanks!

- Henry

The easiest way to create an image was to auto-layout Use the code below to remove the program. Since you can not set the image.translatesAutoresizingMaskIntoConstraints = Yes , if you add an image using the IB to see the applet with the "bug" auto layout. Because you get an error, " Unable to satisfy the hassles together "

So you need to program this because IB added obstacles and no one wants you .

  UIImageView * image = [[UIImageView alloc] initWithFrame: CGRectMake (20, 20, 100, 100)]; Image.image = [UIImage imageNamed: @ "gorilla_red.png"]; Image.translatesAutoresizingMaskIntoConstraints = Yes; [Self.view addSubview: image];    

No comments:

Post a Comment