开发者

drawing an image in a customized UIView

I'm drawing an image... but my problem is that if there's another imageview in the view, my drawn image (green circle) is not visible, seems it's a lower layer than the im开发者_运维知识库ageView.

First, what I've do is that I subclass UIView, MyDrawView, in this is class I do the drawing functionality. Then, I set in IB the view to be MyDrawView.

Here's my sample code: http://snipplr.com/view/37149/draw-image/

Can you advise me how to fix this problem?

Thanks


Subviews are in front of the view that contain them. So you could use the background view as "main view" for your view controller, and add your custom view as a subview to it.

Make sure that you call the correct init method on your custom view class, so that the image actually gets initialized.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜