开发者

draw in a sub view added programmatically?

I have a UIScrollView added programmatically to a UIView. 开发者_开发技巧I want to draw few images to the UIScrollView itself. I know how to draw in the main view using:

[image drawInRect....];

but I just can not understand how to do it inside of a sub view? i fill that I don't truly understand what is the context and how do i reach it?

thanks for any help. shani


If you are asking how to add an image to a uiscrollview which has been added programatically then it is simple.

Add the image to a UIImageView then add that Imageview to the scroll view using addSubview: method.

[scrollView addSubview:imageView];


Well if any one wants to know - the solution is to draw the images to the layer of the UIScrollView. you can not draw to the view itself without sub classing it.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜