I have a subclassed UIView that will not draw it’s subviews. Or at least, it’s not showing it’s subviews. The whole view is loaded from a nib.
Also, strangely, it will not draw the background I set in IB. (I’m using Xcode 4.2).
But it will draw the parent view what I specify in awakeFromNib such as background, border, and corner.
The opaque property is set to NO. Any suggestions are appreciated!
When you load a view from a nib, e.g. using
you still need to then add that loaded view as a subview to one of the views currently visible in your window for that view to become visible. Having an outlet to it from your owner ensures that the view is loaded and you have a reference to it – but that alone does not cause it to be added as a subview to the owner.
So (assuming self is the parent view and the owner in the nib) make sure first that you definitely have the outlet set in the nib from the owner to the view being loaded, and then that you are doing a
(Where loaded view is the view in the nib who’s owner is self).