-2

我正在构建一个应用程序,一个示例我有 MapView,它会显示许多 annView,问题是我怎样才能让它变得与众不同,带有一个小标题,例如数字或类似符号的东西

UIImage 能做到吗?

我想做类似 Yelp 的东西

+ (UIImage *) imageWithView:(UIView *)view
{
    UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, 0.0);
    //UIGraphicsBeginImageContext(view.bounds.size);
    [view.layer renderInContext:UIGraphicsGetCurrentContext()];
    UIImage * img = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();

    return img;
}
4

1 回答 1

1

如果我正确理解了您的问题,听起来您可以使用包含 UIImageView 和 UILabel 的自定义 UIView 获得所需的内容。

于 2011-07-25T09:51:47.380 回答