Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Graphical glitch as sub view of tabbarcontroller. #10

Hackmodford opened this Issue · 5 comments

2 participants


I've added the panel as a sub view of my tabbarcontroller controller. When the app rotates, the grey background doesn't cover the navbar or the tabbar. When the rotation finishes it appears normal again. Any Ideas?


pic? code?


This is my code

[self.customImageView whenTapped:^{

            MA_MobileAppDelegate *appDelegate = (MA_MobileAppDelegate *)[[UIApplication sharedApplication] delegate];

            UAModalPanel *modalPanel = [[MSPicturePreview alloc] initWithFrame:appDelegate.tabBarController.view.bounds withimage:self.customImageView.image];

            [appDelegate.tabBarController.view addSubview:modalPanel];

            [modalPanel showFromPoint:[self.contentView convertPoint:[self.customImageView center] toView:appDelegate.tabBarController.view]];

        } ];

Here are some pics demonstrating the issue.

If you look at the pic that's rotating you can see how the navbar is lighter than when it has fully rotated.


The rotation of the UIModalPanel is standard UI rotation code. The reason you are seeing this is because the panel's background (the transparent dark mask) is being applied to the view, and not being applied to the window itself.

The way to solve it would be to make the background of the modalPanel view clear instead, then create a new subview with the semi-transparent masking layer and add it to the the window instead of the controller view. It would have to be added underneath the modalPanel, so some reworking would need to be done, but it is doable. The modalPanel would still be added to the controller. If you add it, be sure to submit a pull request.

Alternatively, you could not change any code and add the panel to the window itself, but then you lose all the auto-rotation that comes built in with adding a view to a view controller. You would have to implement your own rotation transform code and logic.


What about adding a new view to the app window in the app delegate that's only used for this? Would that be simpler?


You could change the background color in the modalPanel to clear and then add a mask view yourself to the window. You would have to add the animation code to have it fade in and logic to fade it out it when the panel is removed but otherwise should work fine.

@coneybeare coneybeare closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.