-
Notifications
You must be signed in to change notification settings - Fork 911
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
UIAlertView dismissal in non-portrait orientations #60
Comments
I can confirm this issue; how does your workaround look like exactly? |
I have a branch with a proposed fix. Can you give it a try and let me know if it works for you? Here's the fix: Here's the branch: https://github.com/gorbster/KIF/tree/handle-transformed-windows |
I'm afraid it's not 100% right - it looks better and promising, but it's not perfect. Please find attached a test project at http://dl.dropbox.com/u/119600/transfer/KIF.zip In that app, I made an iPad app with loooots of 5x5 UIButtons, containing a title representing their position, e.g. the UIButton with the CGRectFrame(50, 120, 5, 5) contains the title "50 120". Now, I did a test which taps the app at position
And the buttons at those positions are
Thanks a lot for your help, it's really appreciated! |
Your sample project doesn't seem demonstrate an issue with KIF. You're using +stepToTapScreenAtPoint: to tap your buttons. This method operates at the UIWindow level, not the UIView level. The coordinate system for UIWindow is always portrait, so the taps' coordinates are never converted to the device orientation. What you probably want to look at is +stepToTapViewWithAccessibilityLabel. Remember that KIF works around the concept of accessibility labels assigned to your view elements. I modified your scenario code to the following:
And added an accessibilityLabel string to your buttons:
And the KIF test results look accurate:
|
Sorry, I confused the issues... I thought we're in this one here: #112 Your fix works; it's important to use the window with windowLevel normal, otherwise there are problems when e.g. a UIAlertView is currently displayed. |
Did this end up getting merged? I'm currently having the same issue and while I've got no problem patching our version I'd prefer not to deviate too far from master :) |
Currently experiencing the same issue. Is there a reason this is an issue, not a pull request? Or is there some problem with the proposed fix? |
+1 for this patch. Works fine for me too! I'd be very happy to see this pulled. (Thanks Brian!) |
+1 This patch fixes issues for me. |
The following method should provide hours of fun: [system simulateDeviceRotationToOrientation:UIDeviceOrientationLandscapeLeft]; I used this to validate and fix issues #60 using the approach outlined in that issue.
Fixed in master. Thanks! |
I'm running into issues with UIAlertViews not being dismissible in device orientations other than
UIDeviceOrientationPortrait
. If the device is inUIDeviceOrientationPortrait
, I can easily dismiss the alert with:However, this doesn't work for any other orientation, including
UIDeviceOrientationPortraitUpsideDown
.The problem seems to be that
_UIAlertOverlayWindow
always considers itself in regular portrait orientation.So the
-convertRect:toView:
call on theUIThreePartButton
's window in+stepToTapViewWithAccessibilityLabel:value:traits:
returns a frame with bogus coordinates and an inverted size, which is never a tappable point.I've got a workaround for this by ensuring that the
-convertRect:toView:
happens on an application window with a windowLevel of UIWindowLevelNormal, i.e. always doing the-convertRect:toView
: in the application's "main" window. But I wanted to see if anyone else could confirm this issue.I have a sample project at http://dl.dropbox.com/u/33175/LandscapeAlert-KIF.zip - if you run the project in different simulator orientations, you should see the issue.
-Brian
The text was updated successfully, but these errors were encountered: