dismiss

ResignFirstResponder doesn't dismiss the keyboard (iPhone)

时光总嘲笑我的痴心妄想 提交于 2019-11-29 02:26:50
I've searched through this site that I couldn't find a solution to the problem I'm facing now. Hope someone can help. I've created a UIAlertView to prompt user to enter their name in an iPhone app. UIAlertView *enterNameAlert = [[UIAlertView alloc] initWithTitle:@"Enter your name" message:@"\n\n\n" delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"OK", nil),nil]; UITextField *enterNameField = [[UITextField alloc] initWithFrame:CGRectMake(16, 83, 252, 25)]; enterNameField.keyboardAppearance = UIKeyboardAppearanceAlert; enterNameField

Dismissing iPad UIPopoverController when BarButtonItem is pushed while it's open

坚强是说给别人听的谎言 提交于 2019-11-28 20:48:24
Using a split view on the iPad, I have the following code: - (void) splitViewController:(UISplitViewController *)svc willHideViewController:(UIViewController *)aViewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)pc { barButtonItem.title = @"Categories"; NSMutableArray *items = [[toolbar items] mutableCopy]; [items insertObject:barButtonItem atIndex:0]; [toolbar setItems:items animated:YES]; [items release]; self.popoverController = pc; } This works well to show the popover when the button is pressed. However, I'd also like to have the

iOS dismiss UIAlertView beforing showing another

冷暖自知 提交于 2019-11-28 17:17:09
I have a Utils class which shows UIAlertView when certain notifications are triggered. Is there a way to dismiss any open UIAlertViews before showing a new one? Currenty I am doing this when the app enters the background using [self checkViews:application.windows]; on applicationDidEnterBackground - (void)checkViews:(NSArray *)subviews { Class AVClass = [UIAlertView class]; Class ASClass = [UIActionSheet class]; for (UIView * subview in subviews){ if ([subview isKindOfClass:AVClass]){ [(UIAlertView *)subview dismissWithClickedButtonIndex:[(UIAlertView *)subview cancelButtonIndex] animated:NO];

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

﹥>﹥吖頭↗ 提交于 2019-11-28 11:29:11
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://google.com"); ProgressDialog pd = ProgressDialog.show(Home.this, "", "Loading. Please wait...", true)

How to dismiss the two or more dismissModalViewController?

你。 提交于 2019-11-28 04:29:39
问题 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,

How to dismiss a DialogFragment when pressing outside the dialog?

会有一股神秘感。 提交于 2019-11-28 04:16:01
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 intercepting touch events in the 'parent' activity but apart from not getting any touch event, it didn't seem

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

↘锁芯ラ 提交于 2019-11-27 22:20:17
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) { getOps().cancelLogin(); enableControls(); } }); loadingSnack.getView().setOnTouchListener(new View

Dismiss more than one view controller simultaneously

我怕爱的太早我们不能终老 提交于 2019-11-27 18:21:37
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. Is there any way I can fix this without using navigation controller? This is the 1st VC: (Please pay

ResignFirstResponder doesn't dismiss the keyboard (iPhone)

故事扮演 提交于 2019-11-27 16:52:00
问题 I've searched through this site that I couldn't find a solution to the problem I'm facing now. Hope someone can help. I've created a UIAlertView to prompt user to enter their name in an iPhone app. UIAlertView *enterNameAlert = [[UIAlertView alloc] initWithTitle:@"Enter your name" message:@"\n\n\n" delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"OK", nil),nil]; UITextField *enterNameField = [[UITextField alloc] initWithFrame:CGRectMake

Dismissing iPad UIPopoverController when BarButtonItem is pushed while it's open

穿精又带淫゛_ 提交于 2019-11-27 13:12:32
问题 Using a split view on the iPad, I have the following code: - (void) splitViewController:(UISplitViewController *)svc willHideViewController:(UIViewController *)aViewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)pc { barButtonItem.title = @"Categories"; NSMutableArray *items = [[toolbar items] mutableCopy]; [items insertObject:barButtonItem atIndex:0]; [toolbar setItems:items animated:YES]; [items release]; self.popoverController = pc