Guest User

Untitled

a guest
Jul 17th, 2012
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment