结合标签文字和图像 [英] Combine Label Text With Image
问题描述
我有一张带有标签的图像,但是当我将照片保存到相册时,标签当然不会显示.我将如何执行此操作,搜索了很多内容,但没有任何效果.
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屋!