1

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

4

1 回答 1

1

您可以通过以下代码截取mapview并通过链接发送多媒体短信

 - (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;
}
于 2011-04-25T04:50:34.097 回答