c# - How to have the parent UIView Appears ABOVE it's UIImageView sub-view -
i have class extends uiview, , has uiimageview added subview when uiview constructed. override draw method (aka drawrect) , draw on current cgcontext fine if don't add uiimageview or if set opaque false , backgroudcolor clear , leave image set null (aka nil). once set backgroundcolor of uiimageview real color, or set image on uiimageview other null draw being drawn under uiimageview.
this seems odd if if draw on parent's context should appear above sub views. seems stack upside down 1 think. seems 1 expect highest layer parent sub views being added lower layers in order added. doesn't seem case.
i tried sending sub view front , didn't change anything.
basically if parent view opaque false , it's background color clear expect shapes or lines draw on it's context in draw method shown on top of subviews may have.
how can draw on parent view , while showing below being drawn subview?
is there documentation on apple's site explains z-order of parent view , sub views?
examples in c# or objective-c fine.
the behavior seeing correct! in uikit view draws in drawrect , framework handles drawing of subviews on top of it.
there isn't way change since apple has kind of hard coded z order. make sense. instance, if have background image , want add person [backgroundview addsubview:personview] , expect person view drawn on top of backgroundview.
if want draw on image drawing in different view , add on top:
[mainview addsubview:myimageview] [mainview addsubview:mycustomoverlayview]
Comments
Post a Comment