-
Notifications
You must be signed in to change notification settings - Fork 135
-
Notifications
You must be signed in to change notification settings - Fork 135
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
Comments
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. 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. |
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. |
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?
The text was updated successfully, but these errors were encountered: