结合标签文字和图像 [英] Combine Label Text With Image

查看:42
本文介绍了结合标签文字和图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一张带有标签的图像,但是当我将照片保存到相册时,标签当然不会显示.我将如何执行此操作,搜索了很多内容,但没有任何效果.

I have an image with a label that comes over it, but when I save photo to album, of course the label doesn't show up. How would I do this, I have search a lot, and nothing works.

推荐答案

我在其他问题上做了一些研究,为您提供答案(

I did a bit of research in other questions to come up with an answer for you (click here for the best and most detailed answer), but the short answer for you would be this:

如果确实将标签和图像组合到一个UIView对象中(我们称之为myView),则可以执行以下操作:

If you do combine your label and image into one UIView object (let's call it myView), you can do something like this: something like this:

UIGraphicsBeginImageContext(myView.bounds.size);
[myView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

viewImage UIImage对象就是保存到相册的对象.

And the viewImage UIImage object would be what you save to the album.

这篇关于结合标签文字和图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆