Thursday 15 January 2015

uiimageview - IOS: compass in my app -


I have this code to insert a compass in my app:

  - (Zero) Position Manager: Manager (CLLocationManager *) Updating: (CLHeading *) newHeading {// Convert Degree to Radian and Move Needle Float Old Rad = -manager.heading.trueHeading * M_PI / 180.0f; Float newRad = - New heading. Trunting heading * M_PI / 180.0f; CABasicAnimation * theAnimation; TheAnimation = [CABASIC with Animation Animation: @ "Transformation. Ration"]; TheAnimation.fromValue = [flanked with NSNumber number: old RAD]; TheAnimation.toValue = [NSNumber number with Flat: NewRad]; TheAnimation.duration = 0.5f; [CompassImage.layer addAnimation: Animation for KEY: @ "Ammmentation"]; CompassImage.transform = CFE Refined Transformer (Nurad); }   

It works fine but sometimes it happens that the image of the compass is modified and it seems to be spreading ... I do not know what the problem is Can you help me?

  // try it - (zero) location manager: Manager (CLLocationManager *) Heading: (CLHeading *) newHeading {// [manager stopUpdatingHeading]; Double rotation = new heading Magnetic Heading * 3.1415 9/180; [_compass_image Set Transform: CGAffineTransformMakeRotation (-Reproduction)]; }    

No comments:

Post a Comment