带有地图的当前位置



hai我正在创建一个应用程序。我想用gps和没有gps的短信向用户发送当前位置和地图。这可能吗?如果有人知道,请帮帮我。给出一些示例教程或代码。感谢

您可以通过以下代码拍摄地图视图的屏幕截图,并通过链接发送多媒体短信

 - (UIImage *)captureView:(UIView *)view 
{
    CGRect screenRect = [[UIScreen mainScreen] bounds];
   UIGraphicsBeginImageContext(screenRect.size);
  CGContextRef ctx = UIGraphicsGetCurrentContext();
  [[UIColor blackColor] set];
  CGContextFillRect(ctx, screenRect);
  [view.layer renderInContext:ctx];
   UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
  UIGraphicsEndImageContext();
  return newImage;
}

最新更新