2

i am using UIPresentationController for custom modal presentation for menuenter image description here

this part is fine , let say i have clicked 'feedback' i am presenting another controller on top of it .

the problem is after dismissing feedback controller the size of menu view become full enter image description here

my presentation controller class is below

#import "MRMenuPresentationController.h"

@implementation MRMenuPresentationController

@synthesize dimmingView;


-(void)presentationTransitionWillBegin
{

    UITapGestureRecognizer * theTapGesture = [UITapGestureRecognizer new];

    theTapGesture.numberOfTapsRequired = 1;

    theTapGesture.numberOfTouchesRequired = 1;

    [theTapGesture addTarget:self action:@selector(handleTap:)];

    dimmingView = [UIView new];

    [dimmingView addGestureRecognizer:theTapGesture];

    dimmingView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.7];

    self.dimmingView.frame = self.containerView.bounds;

    self.dimmingView.alpha = 0.0;

    [self.containerView addSubview:dimmingView];
    [self.containerView addSubview:self.presentedView];

    // Fade in the dimming view alongside the transition
    id<UIViewControllerTransitionCoordinator> transitionCoordinator = self.presentingViewController.transitionCoordinator;

    [transitionCoordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) {

        self.dimmingView.alpha  = 1.0;

    } completion:nil];


}

-(void)presentationTransitionDidEnd:(BOOL)completed
{
    if (!completed) {

        [self.dimmingView removeFromSuperview];
    }
}

-(CGRect)frameOfPresentedViewInContainerView
{
    CGRect frame = self.containerView.bounds;

    frame.size.width = frame.size.width - 50 ;

    return frame;
}

-(void)dismissalTransitionWillBegin
{
    id<UIViewControllerTransitionCoordinator> transitionCoordinator = self.presentingViewController.transitionCoordinator;

    [transitionCoordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) {

        self.dimmingView.alpha  = 0.0;

    } completion:nil];

}

-(void)dismissalTransitionDidEnd:(BOOL)completed
{
    if (completed) {

        [self.dimmingView removeFromSuperview];
    }
}

please tell what i am missing

Thanks in advance

Shaik Riyaz
  • 11,204
  • 7
  • 53
  • 70
  • did you try to override other methods of `UIPresentationController` which deal with size? – hasrthur Mar 07 '15 at 20:29
  • How do you present the feedback controller? Which presentation style does it have? – egdmitry Mar 13 '15 at 22:16
  • solved this by using UIModalPresentationOverFullScreen presentation style when presenting from the view controller with custom size. I have an answer here: http://stackoverflow.com/questions/32792202/uipresentationcontroller-changes-size-when-another-view-controller-is-displayed – riadhluke Oct 28 '15 at 07:46

0 Answers0