dismiss

How to know if a dialog is dismissed in Android?

半世苍凉 提交于 2019-11-30 06:27:38
If the dialog is dismissed,I want to do something for my background.So I want to know if the dialog is dismissed You can use an onDismissListener http://developer.android.com/reference/android/content/DialogInterface.OnDismissListener.html public Dialog createDialog() { Dialog d = new Dialog(this); d.setOnDismissListener(new OnDismissListener() { @Override public void onDismiss(final DialogInterface arg0) { // do something } }); return d; } If you are using a DialogFragment just override onDismiss() http://developer.android.com/reference/android/app/DialogFragment.html#onDismiss(android

is there a way NOT to have the popover dismissed when pressing outside it?

萝らか妹 提交于 2019-11-30 05:30:21
I know the SDK documentation says Taps outside of the popover’s contents automatically dismiss the popover. But I'm sure the smart people here found a way :) maybe I should overwrite the popover dismiss function? Thanks EDIT: I tried using the passthroughViews as was suggested here, and it works perfectly. Here's the code for whoever needs it - in this example, I put self.view in the array, which means that where ever outside the button where the popover was originated, nothing dismiss the popover. popoverController.passthroughViews = [[[NSArray alloc] initWithObjects:self.view, nil]

How to dismiss a modal VC with fade out animation?

时光怂恿深爱的人放手 提交于 2019-11-30 04:54:14
I am using the following code in my presenting VC to fade in the child modal VC, and this works fine: self.infoViewController.view.alpha = 0.0; [self.navigationController presentModalViewController:self.infoViewController animated:NO]; [UIView animateWithDuration:0.5 animations:^{self.infoViewController.view.alpha = 1.0;}]; However I can't get it to fade out, I have tried a few things, this is the latest I tried that doesn't work: - (IBAction)dismissAction:(id)sender { if ([[self parentViewController] respondsToSelector:@selector(dismissModalViewControllerAnimated:)]) { [[self

iPad 'dismiss keyboard' button doesn't dismiss keyboard

别等时光非礼了梦想. 提交于 2019-11-29 18:12:20
I have a UITextField in a Landscape view, and when I press the 'dismiss keyboard' button in the lower right of the UIKeyboard view, the keyboard does NOT disappear. Is there a way to programmatically listen for when this key was pressed? Or is there a connection I am not seeing that will make this keyboard go away? This is iOS 4 and XCode 4. Thanks. I had same problem today and I wondered, wy it works in Apple's KeyboardAccessory Sample Code. So I did reverse engineering. The ViewController was not the mistake I made in my case. In the implementation of UIApplicationDelegate there is the entry

`unrecognized selector sent to instance <OBJ_ADR>`after sending `dismissViewControllerAnimated:completion` to a UIViewController

空扰寡人 提交于 2019-11-29 16:51:13
Lots of similar questions but non with a solution that works in my case. I try to write a simple FlipSideApp. Just two views with a single button each (flipBtn | flopBtn) to present the other view vice versa. flip on the first view works fine. flop on the other view causes a unrecognized selector sent to instance 0x6c3adf0 . The App crashes after calling [self dismissViewControllerAnimated:YES completion:nil]; in file FlipSide.m (see code below). Where 0x6c3adf0 is the current address of self which is an instance of FlipSide : UIViewController in that case. So I think the unrecognized selector

FloatingActionButton does not come down when dismissing Snackbar

一个人想着一个人 提交于 2019-11-29 13:53:44
问题 I am trying to use a Snackbar . I have a FloatingActionButton wrapped in a CoordinatorLayout . When the Snackbar shows, the button is correctly moved up. When it dismisses automatically, the button moves down. But if I dismiss the Snackbar programmatically, the button does not go down. My code is simple: mSnackbar = Snackbar.make(mCoordinatorLayout, text, Snackbar.LENGTH_LONG) .setAction(R.string.undo, new View.OnClickListener() { @Override public void onClick(View v) { undoDeleteTasks(); } }

How to dismiss AlertDialog.Builder?

。_饼干妹妹 提交于 2019-11-29 11:15:42
问题 In the following code below, how do I dismiss the alert box? I don't want to cause a memory leak. I tried the .dismiss() on alertDialog, but that didn't work... Thanks // User pressed the stop button public void StopMsg_button_action(View view){ final EditText password_input = new EditText(this); // create an text input field password_input.setHint("Enter Password"); // put a hint in it password_input.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); // change

How to dismiss the two or more dismissModalViewController?

不问归期 提交于 2019-11-29 10:53:06
I need to dismiss the two modal view controllers, I know how to pop two or more view controllers UINavigationController* navController = self.navigationController; NSArray *array=[navController viewControllers]; UIViewController* controller = [navController.viewControllers objectAtIndex:0]; [navController popToViiewController:controller animated:YES]; This is how i can navigate back to my first view but if there are two or more dismiss modal view then how can i navigate back please help me, Thank you, Madan Mohan From the docs for -[UIViewController dismissModalViewController] : If you present

How to know if a dialog is dismissed in Android?

为君一笑 提交于 2019-11-29 05:11:01
问题 If the dialog is dismissed,I want to do something for my background.So I want to know if the dialog is dismissed 回答1: You can use an onDismissListener http://developer.android.com/reference/android/content/DialogInterface.OnDismissListener.html public Dialog createDialog() { Dialog d = new Dialog(this); d.setOnDismissListener(new OnDismissListener() { @Override public void onDismiss(final DialogInterface arg0) { // do something } }); return d; } If you are using a DialogFragment just override

How to dismiss a modal VC with fade out animation?

吃可爱长大的小学妹 提交于 2019-11-29 02:57:15
问题 I am using the following code in my presenting VC to fade in the child modal VC, and this works fine: self.infoViewController.view.alpha = 0.0; [self.navigationController presentModalViewController:self.infoViewController animated:NO]; [UIView animateWithDuration:0.5 animations:^{self.infoViewController.view.alpha = 1.0;}]; However I can't get it to fade out, I have tried a few things, this is the latest I tried that doesn't work: - (IBAction)dismissAction:(id)sender { if ([[self