How to make a view above a button? Objective-c

What I do to display the view, when the user clicks on something, I hide the view from the field of view, and then insert it. It slides over my control, but not above my button. enter image description here The second image shows a slide event passing through a segment control, but not a button leaving a button there that looks awkward. How can I show the slide on the right that appears above all my components, including my today's button? enter image description here

here is my code to show the slide controller.

self.eventsViewController = nil; self.eventsViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"eventsViewController"]; self.eventsViewController.view.frame = CGRectMake(self.view.frame.size.width, self.view.frame.origin.y, 700, self.view.frame.size.height); [self addChildViewController:self.eventsViewController]; [self.view addSubview:self.eventsViewController.view]; [self.eventsViewController didMoveToParentViewController:self]; [UIView animateWithDuration:0.44 animations: ^(void){ if (UIInterfaceOrientationIsPortrait(self.interfaceOrientation)) { self.eventsViewController.view.frame = CGRectMake(200 , 75 ,568 ,900); } else { self.eventsViewController.view.frame = CGRectMake(333 , 75 ,690 ,630); } }]; 

edit: viewcontroller event image with color

enter image description here

+4
source share
1 answer

Have you tried to bring your eyes to the fore?

 [self.view bringSubviewToFront:self.eventsViewController.view]; 

Or send back your button.

+2
source

Source: https://habr.com/ru/post/1496888/


All Articles