开发者

can UIimage have text or string at xcode?

开发者 https://www.devze.com 2023-03-22 21:09 出处:网络
I was building an application, an example I have MapView that will show many annView, the question is How can I make it all different, with a little subtitle, such as number or something like symbol

I was building an application, an example I have MapView that will show many annView, the question is How can I make it all different, with a little subtitle, such as number or something like symbol

can UIImage do that?

I want to make something like Yelp

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

    return img;
}


If I'm understanding your question correctly it sounds like you could get what you want with a custom UIView that contained a UIImageView and a UILabel.

0

精彩评论

暂无评论...
验证码 换一张
取 消