Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graphical glitch as sub view of tabbarcontroller. #10

Closed
Hackmodford opened this issue Jun 17, 2012 · 5 comments
Closed

Graphical glitch as sub view of tabbarcontroller. #10

Hackmodford opened this issue Jun 17, 2012 · 5 comments

Comments

@Hackmodford
Copy link

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?

@coneybeare
Copy link
Member

pic? code?

@Hackmodford
Copy link
Author

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.

http://dl.dropbox.com/u/6851931/2012-06-17%2011.08.42.jpg

http://dl.dropbox.com/u/6851931/2012-06-17%2011.08.47.jpg

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

@coneybeare
Copy link
Member

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.

@Hackmodford
Copy link
Author

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

@coneybeare
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants