在 UIImageView 中的多个位置绘制 UIImage
我有点迷失在 UIImage、UIImageView、CG、图层之间...... 我想在同一个 UIImageView 中多次绘制同一个 UIImage。我不想为每个对象都有一个单独的子视图。有一个平面图像就足够了。我该怎么做?
I'm kind of lost in between UIImage, UIImageView, CG, layers...
I want to draw the same UIImage multiple times in the same UIImageView. I don't want to have a separate subview for each of those objects. It's enough to have a flat image. How do I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我发现这个是因为我也在寻找这个问题的答案
http://www .cocoanetics.com/2010/07/drawing-on-uiimages/
i found this as i was also looking for answers to this question
http://www.cocoanetics.com/2010/07/drawing-on-uiimages/
UIImageView 不允许你这样做。相反,我建议您使用常规 UIView 并使用 drawRect: 函数来绘制图像。如果您想知道如何做到这一点,请查看 Core Graphics 文档。
UIImageView does not allow you to do that. Instead, I would recommend you to use a regular UIView and use the drawRect: function to draw the images. Take a look at the Core Graphics docs if you want to know how to do that.
您必须创建多个 UIImage 对象才能执行此操作。实际上
UIImageView
是错误的选择。创建一个UIView
并向其添加多个UIImageView
对象。对不起。You'll have to create multiple
UIImage
objects to do this. Really aUIImageView
is the wrong choice. Create aUIView
and just add mulitpleUIImageView
objects to it. Sorry.嗯,我想这很简单,
可以使用以下代码来制作 myTextView
Well I guess it is simple
where myTextView can be made using the following piece of code