0

I create a UIImageView object,and add some subviews to it,such as textview,imageview,label and so on. Now I want to get an image of the UIImageView with its all subviews.

Help me. Thanks.

Vic
  • 61
  • 1
  • 7

1 Answers1

0

Not sure I got your question right.
UIImageView has property image to assign UIImage to it.
UIImage is subclass of UIView, so definitely you can insert subviews in it like in any other view. But I think, it is quite unusual. What I do in such situations? Take UIView as holder, insert UIImageView and other subviews in it.

If you need quite opposite, make UIImage from UIView on screen, have a look at UIGraphicsGetImageFromCurrentImageContext() function, here you may find some further explanation.

Community
  • 1
  • 1
Valeriy Van
  • 1,851
  • 16
  • 19