ios - Adding a new view on top of an existing view -


I want to add a view called anotherView at the top of self.view. But I do not want to see another scene as a subview. Is this possible?

I must be at the top of another watch page and push my own content accordingly (to change the values ​​without YY or height.) I have the following And it does not work:

  UIView * anotherView = [[UIView alloc] initWithFrame: CGRectMake (0, 0, self.view.frame.size.width, 80)]; AnotherView. BackgroundColor = [UIColor yellowColor]; [self.view InsertSubeweve: another view on topSupview: self.view];  

The box is just at the top of the current view.

Any view sequence is a subview of any other view or window.

But you can add another view from

  Self.view.superview  

or even

  self.view.window  

or newer Create UIWindow object and add your subview in this window


Comments