【问题标题】:current location with map当前位置与地图
【发布时间】:2011-04-25 13:58:47
【问题描述】:

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

【问题讨论】:

    标签: iphone sms mkmapview userlocation


    【解决方案1】:

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

     - (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;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-11-11
      • 2016-04-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-06
      • 1970-01-01
      相关资源
      最近更新 更多