-
Notifications
You must be signed in to change notification settings - Fork 213
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
SplitViewController in portrait - popover appears behind mainView on detailView #21
Comments
Hello, OK, so I'm not 100% sure I understand what's going on. It sounds like the SplitViewController is in a window above the key window, or possibly has its layer's zPosition set above all other views. I'm going to try and work on a solution to this problem this weekend by just adding another UIWindow onto the stack to get around all these problems. This is now the biggest problem with the component. Oliver Oliver C. Rickard On Thursday, 31 January 2013 at 10:58, DrBeak1 wrote:
|
This is where the issue seems to be occurring in:
It seems the key window remains the detailView even though the masterView is clearly on top. |
This is an ugly, ugly fix - but it works:
Also, at this point I'm not sure of the ramifications this will have in other scenarios where you'd be using a SplitViewController's PopoverViewController and this component. |
Has anyone found any other solution to this issue yet? |
So I've updated the project on a new branch, and added a tiny bit of code that may help out here. I really don't know. So I'm throwing it out there in the hopes that it helps you: https://github.com/runway20/PopoverView/tree/New-Window |
OK, I've added a couple of majorly hacky changes to the branch. Mind checking if this works for you? |
Sure thing. Give me about an hour - just stepped away from my desk. Thanks! |
Yep - this solves the orientation problem but adds a new issue: The popups will not dismiss. Also in PopoverView.m, I think your UIViewAnimationCurveEaseInOut need to be changed to UIViewAnimationOptionCurveEaseInOut. Not having the "Option" there causes warnings because this is two different enumeration sets. |
Hmmm... What happens if you set topWindow.userInteractionEnabled = YES? And yep, you caught me! I'll try to fix the warning tonight... |
Doesn't seem to do anything. Perhaps I'm not setting it in the correct place. I've set this here:
I should also note that the first dismissal DOES work. But if you tap a button to show the popover again, it's any following times that the dismiss doesn't work. So -- first time, works great - any time after - not so much. |
If it's going to take hacks to make this work, wouldn't it be simpler just to use the hack I posted above? Post from 2/1/2013:
But I guess this would only work when trying to display the PopoverView on a UIPopoverView on an iPad in portrait orientation. It makes sense to find a more universal solution. |
Yes, that's a good point. To be clear, what I meant by hackish is that it's not that clean, but it IS super general. What I've done is created a UIWindow with a custom subclass of UIViewController to accept the standard autorotation selectors to allow the component to rotate. I believe introduction of a new UIWindow is the only way that we can achieve the display level required by many of the users of the component. If you look at the issues, I think a majority relate to this problem. We could do a case-by-case approach and deal with them individually, but I tried this already, and it just introduces more problems for other users. If it works for you, then awesome, go for it. Now, the problem you're describing with the window approach appears to have two possible causes:
I'll try to play with this soon if I can. |
So I'm not sure if any others have experienced this, but reading through other posts I didn't find anything that was exact.
Currently I have a project that uses a splitViewController. When in landscape I can tap a button in the mainView (leftside view) and the popupView shows up just as expected. However, if I rotate to portrait, swipe right to display the mainView on top of the detailView, then tap the same button the popupView appears behind the mainView on the detailView. If I slide the mainView out of the way the popupView remains there on the detailView.
Any help with this would be great. I'll mess around with things a bit to see if I can fix on my own, just thought I'd mention here.
Thanks!
The text was updated successfully, but these errors were encountered: