dismiss

single function to dismiss all open view controllers

醉酒当歌 提交于 2019-11-27 07:12:17
I have an app which is a single view application. I have a navigation controller linked up to all child controllers from the root view controller. In each child controller, I have a logout button. I'm wondering if I can have a single function I can call which will dismiss all the controllers which have been open along along the way, no matter which controller was currently open when the user presses logout? My basic start: func tryLogout(){ self.dismissViewControllerAnimated(true, completion: nil) let navigationController = UINavigationController(rootViewController: UIStoryboard(name: "Main",

How do i make my progress dialog dismiss after webview is loaded?

≯℡__Kan透↙ 提交于 2019-11-27 06:16:27
问题 What do I need to my code to make the dialog dismiss() after the webview is loaded? public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); CookieSyncManager.createInstance(this); CookieSyncManager.getInstance().startSync(); webview = (WebView) findViewById(R.id.webview); webview.setWebViewClient(new homeClient()); webview.getSettings().setJavaScriptEnabled(true); webview.getSettings().setPluginsEnabled(true); webview.loadUrl("http:

How to dismiss a DialogFragment when pressing outside the dialog?

自作多情 提交于 2019-11-27 05:17:48
问题 I am using a DialogFragment , and while I have successfully set an image to close (i.e. dismiss) the dialog when pressed, I am having a hard time finding the way to dismiss the dialog when the user clicks anywhere outside it, just as it works with normal dialogs. I thought there would be some sort of dialogFragment.setCanceledOnTouchOutside(true); call, but I don't see that in the documentation. Is this possible with DialogFragment at all? Or am I looking in the wrong places? I tried

Dismissing multiple modal view controllers at once?

╄→尐↘猪︶ㄣ 提交于 2019-11-27 03:15:37
问题 So have a stack with three view controllers where A is root, B is first modal view controller and C is third modal vc. I would like to go from C to A at once. I have tried this solution to dismiss.It does work but not in a correct way. That is when the last view controller is dismissed it will breifly show the second view controller before the first is shown. What I'm looking for is a way to get from the third vc to the first in one nice animation without noticing the second view. Any help on

How do I recover the “text” from the page originating the alert, esp **after** the human user has *clicked* [dismiss] on the page's **alert**?

拜拜、爱过 提交于 2019-11-27 02:17:22
Basically, when an alert is popped up in javascript, I can dismiss() it from python perfectly OK, by calling selenium.webdriver.common.alert.Alert(browser).dismiss() . However, if the "browser user" dismisses the alert by clicking [OK] (on screen) with their mouse, then the browser alert gets "Lost in Space" the body.text can no longer be accessed from python. So... How do I recover the "text" from the page originating the alert, esp after the human user has clicked [dismiss] on the page's alert ? Here are the hints and a script to demonstrate the problem... FYI: The objective of the

How to dismiss AlertDialog in android

有些话、适合烂在心里 提交于 2019-11-27 01:24:45
I created AlertDialog that contains 4 buttons OptionDialog = new AlertDialog.Builder(this); OptionDialog.setTitle("Options"); LayoutInflater li = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View v = li.inflate(R.layout.options, null, false); background = (Button) v.findViewById(R.id.bkgSpinnerLabel); SoundVib = (Button) v.findViewById(R.id.SoundVibSpinnerLabel); OptionDialog.setView(v); OptionDialog.setCancelable(true); OptionDialog.setNeutralButton("Ok", new DialogInterface.OnClickListener() { public void onClick(DialogInterface arg0, int arg1) { } }); background

iPhone - dismiss multiple ViewControllers

半城伤御伤魂 提交于 2019-11-26 22:13:24
问题 I have a long View Controllers hierarchy; in the first View Controller I use this code: SecondViewController *svc = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil]; [self presentModalViewController:svc animated:YES]; [svc release]; In the second View Controller I use this code: ThirdViewController *tvc = [[ThirdViewController alloc] initWithNibName:@"ThirdViewController" bundle:nil]; [self presentModalViewController:tvc animated:YES]; [tvc release]; and so on

iPhone - dismiss multiple ViewControllers

不羁的心 提交于 2019-11-26 21:55:36
I have a long View Controllers hierarchy; in the first View Controller I use this code: SecondViewController *svc = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil]; [self presentModalViewController:svc animated:YES]; [svc release]; In the second View Controller I use this code: ThirdViewController *tvc = [[ThirdViewController alloc] initWithNibName:@"ThirdViewController" bundle:nil]; [self presentModalViewController:tvc animated:YES]; [tvc release]; and so on. So there is a moment when I have many View Controllers and I need to come back to the first View

How to disable snackbar's swipe-to-dismiss behavior

為{幸葍}努か 提交于 2019-11-26 20:43:35
问题 Is there a way to prevent the user from dismissing a snackbar by swiping on it? I have an app that shows a snack bar during network login, I want to avoid it to be dismissed. According to Nikola Despotoski suggestion I've experimented both solutions: private void startSnack(){ loadingSnack = Snackbar.make(findViewById(R.id.email_login_form), getString(R.string.logging_in), Snackbar.LENGTH_INDEFINITE) .setAction("CANCEL", new OnClickListener() { @Override public void onClick(View view) {

Dismiss more than one view controller simultaneously

寵の児 提交于 2019-11-26 19:18:14
问题 I'm making a game using SpriteKit. I have 3 viewControllers: selecting level vc, game vc, and win vc. After the game is over, I want to show the win vc, then if I press OK button on the win vc, I want to dismiss the win vc AND the game vc (pop two view controllers out of the stack). But I don't know how to do it because if I call self.dismissViewControllerAnimated(true, completion: {}) the win vc (top of the stack) is dismissed, so I don't know where to call it again to dismiss the game vc.