macoscocoansviewnsimageviewikimageview

subview of IKImageView appears below image instead of above


I have a IKImageView and a NSImageView as a subview. Subviews are supposed to get drawn above their master view. I tried an NSImageView with the same subview, and it worked fine, but I really need to be able to move the image around with the mouse, and zoom it with a slider, and I think IKImageView is a bit easier.

What happens is this: img 1 As you can see, the small picture (subview) is below the image on the IKImageView, but in front of the background of IKImageView. How can I fix this?

ps: Do you think I should use NSImageView? If so, how would I move it around, and zoom?


Solution

  • call addSubview again everytime after I set the IKImageView's image.

    That work for me.