optionDialog will not hide problem
In a navigation group I have a window that shows an optionDialog on the rightNavButton. When navigation to the previous window in the navigationGroup with the optionDialog opened, the optionDialog will not hide itself neither is there a method to hide it programmically. I tried nullifying the optionDialog and the rightNavButton but this did not solve the issue.
Previously I used a Popover with a tableview but this has appearant disadvantages. So if someone can help me solve the issue with the optionDialog it is highly appreciated.
3 Answers
-
Hello, I had the same problem
But in my case was when the app was put on pause and return, my code was causing the app back on a screen asking to login again, and the optionDialog still visible.
To fix I added the function Hide.
Open /Library/Application Support/Titanium/mobilesdk/osx/1.X.X/iphone/Classes/TiUIOptionDialogProxy.m
and before this line:
-(void)show:(id)args
add this code:
-(void)hide:(id)args { [actionSheet dismissWithClickedButtonIndex:-2 animated:animated]; [self fireEvent:@"hide" withObject:nil]; [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationWillChangeStatusBarOrientationNotification object:nil]; RELEASE_TO_NIL(actionSheet); }
Save and do a full compile of your project.
Now you can use in your JS:
myOptionDialog.hide();
-
Dumb question, but have you tried calling youroptiondialog.hide() just to see if that method is there but undocumented? Maybe blur()?
-
Hi Tim,
Thanks for your reply.. Yes, I did notice that the documentation on the .show states that it does not take any parameters while actually it does. So I did try .hide(), and tried .blur() as you suggested, but neither exist.
Regards
Edgar