Reputation: 3517
What I do to display a view when a user taps on something I hide a view out of sight and then slide it in. It slides over my segment control but not over my button. The second image shows my slide event going over the segment control but not the button leaving the button there which looks awkward. How can I show a slide coming from the right that appears over all my components including my today button?
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: image of eventsViewController with colour
Upvotes: 4
Views: 2264
Reputation: 269
Did you tried to bring your view to front?
[self.view bringSubviewToFront:self.eventsViewController.view];
Or send to back your button.
Upvotes: 2