Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 17th, 2012  |  syntax: None  |  size: 0.77 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. UIScrollView - Custom Map - Prevent marker subview on map from scaling with map
  2. CGPoint ULPC = userLocationPlaceholder.center;
  3.     float zs = scrollView.zoomScale;
  4.     CGRect newFrame = CGRectMake(((ULPC.x * zs) - scrollView.contentOffset.x) - 20, ((ULPC.y * zs) - scrollView.contentOffset.y) - 20, 40, 40);
  5.        
  6. -(void)animeUserLocationAttachment
  7. {
  8. [UIView animateWithDuration:0.05
  9.                       delay:0
  10.                     options:(UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionCurveLinear )
  11.                  animations:^{
  12.                      userLocationDotContainer.frame = newFrame;
  13.                } completion:^(BOOL finished){
  14.                      // Call self
  15.                      [self animateUserLocationAttachment];
  16.                  }];
  17. }