Can we add more than one subviews to a window at the same time in iOS?
Is it possible to开发者_如何学JAVA add more than 1 subviews to a given window. Eg. [window addsubview: subview1] [window addsubview: subview2]
where one of the views is UIViewController.
I tried doing it but the UIViewController view overrides the other subview.
Make sure both the views do not have the same size, so they do not overlap each other. Try changing one view's x and y location and background colour to something that stands out from the other one to see what I mean.
A quick look at the UIWindow docs would have revealed it inherited from UIView, to which you can add an arbitrary number of subviews.
Yes you can add multiple subviews to UIWindow
.
For your problem check the frames of the views you add - probably your viewController's view is fullscreen and another view is just under it
精彩评论