Search Results

Search found 72 results on 3 pages for 'resignfirstresponder'.

Page 2/3 | < Previous Page | 1 2 3  | Next Page >

  • Bring to front DatePicker on an UITextField

    - by crazyfr
    Hi, When an UITextField is firstResponder, I would like to bring to front an UIDatePicker (bottom part of the screen) without the "going down keyboard" (no call to UITextField resignFirstResponder). The aim is to process like UIKeyboard of UITextField which pop-up on nearly everything when it becomeFirstResponder. modalViewController seems to be fullscreen only. - showDatePicker:(id)sender { if([taskName isFirstResponder]) [taskName resignFirstResponder]; [self.view.window addSubview: self.pickerView]; // size up the picker view and compute the start/end frame origin (...) [UIView commitAnimations]; } This example is an animation of keyboard going down, and DatePicker going up, behind and not in front. Do you know a solution ? A piece of code would be welcome. Thanks in advance.

    Read the article

  • tableView resize problem when pushing another view while keyboard is showing

    - by Rollin_s
    I have a tableview controller under a navigation controller. Some of my table cells contain text fields, so when I tap on them, a keyboard will show up and automatically resize (shrink) the bounds of my tableview. The bounds is then restored when the keyboard is dismissed programmatically by calling resignFirstResponder on my text field. Some of my cells would push a new view controller into the view stack when tapped on, so I first resign my current textfield before pushing the view controller: - (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath { if (currentEditingTextField != nil) { [currentEditingTextField resignFirstResponder]; currentEditingTextField = nil; } return indexPath; } The problem is when I navigate back to my table view, the bounds of the tableview is sized as if the keyboard is still there. I know this because the scroll indicator only reaches right above where the keyboard was and there is empty view space below the table view. Anybody experienced this and know of a solution? Thanks

    Read the article

  • iPhone SDK - (void)viewDidLoad { } - Show Progress

    - by Hank Brekke
    I have a long - (void)viewDidLoad { } function that uses the internet to load a page, and whenever the application loads the URL, the screen is black. I have a UIActivityIndicator setup to show that the address is loading, but I don't know how to prevent it from seeming as if the application is not responding, and I don't want to show the network activity indicator [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES]; because the screen will still be black, just with a loader in the top corner. My code is below: - (void)viewDidLoad { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; email.text = [defaults objectForKey:@"mom_email"]; pass.text = [defaults objectForKey:@"mom_pass"]; if (email.text != nil && pass.text != nil) { [self login:loginBtn]; } } - (IBAction)login:(id)sender { [email resignFirstResponder]; [pass resignFirstResponder]; [loader startAnimating]; // Does nothing though NSString *em = (NSString *)CFURLCreateStringByAddingPercentEscapes(NULL,(CFStringRef)email.text,NULL,(CFStringRef)@"!*'();:@&=+$,/?%#[]",kCFStringEncodingUTF8); NSString *ps = (NSString *)CFURLCreateStringByAddingPercentEscapes(NULL,(CFStringRef)pass.text,NULL,(CFStringRef)@"!*'();:@&=+$,/?%#[]",kCFStringEncodingUTF8); NSURL *url = [[NSURL alloc] initWithScheme:@"http" host:@"localhost" path:[[NSString alloc] initWithFormat:@"/app/login.php?email=%@&pass=%@", em, ps]]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil]; NSString *loginResult = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding]; [loader stopAnimating]; NSRange range = [loginResult rangeOfString:@"1"]; if (range.location != NSNotFound) { [self dismissModalViewControllerAnimated:YES]; // Doesn't do anything if function called from viewDidLoad } }

    Read the article

  • Remove clear button (grey x) to the right of UISearchBar when cancel button tapped

    - by David Foster
    Right, to begin my question, here's some screenies of the problem already solved by the Spotify app: Spotify's Step 1: Standard UISearchBar not in editing mode. Spotify's Step 2: UISearchBar now in editing mode. Search term entered. Cancel button slides in from the right, and the clear button (grey x) appears. Spotify's Step 3: Cancel button pressed; keyboard slides out and the search bar is no longer in editing mode. Search term remains and the grey x button is now hidden. At present, the following code fires off when my cancel button is pressed: - (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar { [searchBar resignFirstResponder]; [searchBar setShowsCancelButton:NO animated:YES]; } Which results in: My Step 3: Search bar now not in editing mode. Cancel button and keyboard has slid out. Search term remains but so does the grey x. So, my question is this: given that -resignFirstResponder (and -endEditing:, FYI) does not hide the grey x button when a search bar has had text entered into it, how does one hide it? Thanks again, friends.

    Read the article

  • UIAlertView clickedButtonAtIndex with presentModalViewController

    - by Vivas
    Hi, I am trying to call a view via presentModalViewController from a UIAlertView button. The code is below, the NSlog is displayed in the console so I know that code execution is indeed reaching that point. Also, there are no errors or anything displayed: - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if (buttonIndex != [alertView cancelButtonIndex]) { NSLog(@" The username is: %@ AND the password is: %@ ",textField.text,passTextField.text); // do some logic in here later CompanyViewController *companyViewController = [[[CompanyViewController alloc] initWithNibName:@"CompanyViewController" bundle:nil] autorelease]; [self presentModalViewController:companyViewController animated:YES]; } [textField resignFirstResponder]; [passTextField resignFirstResponder]; } * Edit: The method above belongs to a UIViewController. Below is the interface file: @interface testingViewController : UIViewController <UIAlertViewDelegate, UITextFieldDelegate> { UITextField *textField; UITextField *passTextField; } @property (nonatomic, retain) UITextField *textField; @property (nonatomic, retain) UITextField *passTextField; @property (readonly) NSString *enteredText; @property (readonly) NSString *enteredPassword; @end Any help is appreciated.

    Read the article

  • NSTableView selection & highlights

    - by Christian
    I have a NSTableView as a very central part of my Application and want it to integrate more with the rest of it. It has only one column (it's a list) and I draw all Cells (normal NSTextFieldCells) myself. The first problem is the highlighting. I draw the highlight myself and want to get rid of the blue background. I now fill the whole cell with the original background color to hide the blue background, but this looks bad when dragging the cell around. I tried overriding highlight:withFrame:inView: and highlightColorWithFrame:inView: of NSCell but nothing happened. How can I disable automatic highlighting? I also want all rows/cells to be deselected when I click somewhere outside my NSTableView. Since the background / highlight of the selected cell turns gray there must be an event for this, but I can't find it. I let my cells expand on a double click and may need to undo this. So getting rid of the gray highlight is not enough. EDIT: I add a subview to the NSTableView when a cell gets double clicked and then resignFirstResponder of the NSTableView gets called. I tried this: - (BOOL)resignFirstResponder { if (![[self subviews] containsObject:[[self window] firstResponder]]) { [self deselectAll:self]; ... } return YES; } Besides that it's not working I would need to implement this method for all objects in the view hierarchy. Is there an other solution to find out when the first responder leaves a certain view hierarchy?

    Read the article

  • Cannot get UISearchBar Scope Bar to appear in Toolbar on iPad

    - by Jann
    This is really causing me fits. I put a toolbar on the IUView on the iPad. I added the following: Search Bar (not Search Bar and Search Display) to the toolbar. I set the options to be as follows: Show Cancel Button, Show Scope Bar, Scope Button Titles are: "Title1" and "Title2" (with Title2's radio button selected). Opaque, Clear Context and Auto Resize are checked. I hooked up the delegate of Search Bar to the "File's Owner" and linked it to IBOutlet theSearchBar. In my viewWillAppear I have the following: [theSearchBar setScopeButtonTitles:[NSArray arrayWithObjects:@"Near Me",@"Everywhere",nil]]; //Just in case: [theSearchBar setShowsScopeBar:YES]; //doesn't seem to do anything: //[theSearchBar sizeToFit]; searchDisplayController = [[UISearchDisplayController alloc] initWithSearchBar:theSearchBar contentsController:self]; [self setSearchDisplayController:searchDisplayController]; [searchDisplayController setDelegate:self]; [searchDisplayController setSearchResultsDataSource:self]; //again--does not seem to do anything..but people have suggested it: [theSearchBar sizeToFit]; Okay, so far, I thought, so good. So, I made the File's Owner .m file to be a delegate for: UISearchBarDelegate, UISearchDisplayDelegate. My issue: I have yet to implement the delegates necessary to do the search but still... shouldn't I be seeing the scopeBar next to the search field when I click into the search field? Just so you know I DO see the log of the characters I type, so the delegate is working. I have the following dummy functions in the .m file (just in case) // called when keyboard search button pressed - (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar { NSLog(@"Search Button Clicked\n"); [theSearchBar resignFirstResponder]; } // called when cancel button pressed - (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar { NSLog(@"Cancel Button Clicked\n"); [theSearchBar resignFirstResponder]; } - (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText { NSLog(@"Search Text So Far: '%@'\n",searchText); } - (BOOL)searchBarShouldBeginEditing:(UISearchBar *)searchBar { return YES; } - (BOOL)searchBarShouldEndEditing:(UISearchBar *)searchBar { return YES; } Why doesn't the Scope Bar appear? A results UIPopoverController appears with the title "Results" and "No results found" (of course) when i type the first character in my search...but no scope bar. (not that i expect anything other than "No Results Found". I am wondering where the scope bar is supposed to appear...in the titleView of the UIPopover? In the toolbar to the right of the search area? Where?

    Read the article

  • How to dismiss keyboard for UITextView with return key?

    - by iPhoney
    In IB's library, the introduction tells us that when the return key is pressed, the keyboard for UITextView will disappear. But actually the return key can only act as '\n'. I can add a button and use [txtView resignFirstResponder] to hide the keyboard. But is there a way to add the action for the return key in keyboard so that I needn't add another button.

    Read the article

  • Not receiving touchesEnded/Moved/Cancelled after adding subView

    - by Sam
    Title more or less says it all. In response to a touchesBegan event, my UIViewController recolours itself and adds some subviews. It never receives the touchesEnded. I guess because the added subviews are somehow intercepting the event. I tried calling resignFirstResponder on the subviews to no avail. The code works fine when I don't add the child views and the touch events are called as normal. Any ideas? Thanks

    Read the article

  • Keyboard problem on iPhone OS 4.0 (8A248c)

    - by Newbee
    Hi! I have view with text field -- subclassed from UIAlertView. In the textFieldShouldReturn delegate I call resignFirstResponder for text field and dismissWithClickedButtonIndex for view. On the 3.x version everything fine, but on 4.0 keyboard still present on screen after view dismissing and doesn't disappear while app running. App compiled for 3.0 target and tested on 4.0 iPhone OS. One more thing - sometimes after dismissing alert - Done button on the keyboard replaces with Return button.. Any suggestions ?

    Read the article

  • iPhone OS 3.2 (iPad) Modal View question

    - by user308475
    I am presenting a UIViewController as a modal viewcontroller with modalPresentationStyle = UIModalPresentationFormSheet. I have few UITextFields on its view. My issue is that when I try to dismiss the keyboard ([textfieldname resignFirstResponder]), it doesn't do anything. However when I change the modalPresentationStyle to UIModalPresentationPageSheet, it works. This seems to be a bug. Has any one faced similar problems and found a work around? Could I be doing anything dumb and silly?

    Read the article

  • Runtime error on Did End On Exit in iPhone application

    - by Deepak Pillai
    Does anyone know why im getting runtime error when i click on return button on iphone keyboard. I need to hide keyboard after done editing values to UITextField. So i assigned Did End On Exit to IBAction and the IBAction code below -(IBAction)FinishEditing:(id)sender { [folderName resignFirstResponder]; } When running ma project i facing a runtime error and the variable values shown below argv char ** 0xbffff58c *argv char * 0xbffff6b8 **argv char '/' Console Value (lldb) Any idea to overcome this issue??

    Read the article

  • Cursar move to the next line using textview

    - by user990918
    Hi friends i am trying to move curser move to the next line. it is worked but when i enter a character in textview curser again back to first line. please help me any one. i am writing below code.` if (textView == mailBodyTxtVew) { textView.text= [textView.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; //[textView resignFirstResponder]; // return NO; } `

    Read the article

  • Cannot get UISearchBar Scope Bar to appear in Toolbar (or anywhere) on iPad

    - by Jann
    This is really causing me fits. I see a lot of info on putting a UISearchBar in the top row of a UITableView -- but I am putting the UISearchBar into the Toolbar at the top of my screen (on the iPad). I cannot find ANYTHING regarding how to handle UISearchBar and UISearchDisplayController using a UIPopoverController on the iPad. Any more info about the UISearchDisplayController using a UIPopoverController would be greatly appreciated. Please help with this as I am at my wit's end. Using IB, I put a toolbar on the IUView on the iPad. I added the following: Search Bar (not Search Bar and Search Display) to the toolbar. I set the options to be as follows: Show Cancel Button, Show Scope Bar, Scope Button Titles are: "Title1" and "Title2" (with Title2's radio button selected). Opaque, Clear Context and Auto Resize are checked. I hooked up the delegate of Search Bar to the "File's Owner" and linked it to IBOutlet theSearchBar. In my viewWillAppear I have the following: //Just in case: [theSearchBar setScopeButtonTitles:[NSArray arrayWithObjects:@"Near Me",@"Everywhere",nil]]; //Just in case (again): [theSearchBar setShowsScopeBar:YES]; //doesn't seem to do anything: //[theSearchBar sizeToFit]; searchDisplayController = [[UISearchDisplayController alloc] initWithSearchBar:theSearchBar contentsController:self]; [self setSearchDisplayController:searchDisplayController]; [searchDisplayController setDelegate:self]; [searchDisplayController setSearchResultsDataSource:self]; //again--does not seem to do anything..but people have suggested it: [theSearchBar sizeToFit]; Okay, so far, I thought, so good. So, I made the File's Owner .m file to be a delegate for: UISearchBarDelegate, UISearchDisplayDelegate. My issue: I have yet to implement the delegates necessary to do the search but still... shouldn't I be seeing the scopeBar next to the search field when I click into the search field? Just so you know I DO see the log of the characters I type, so the delegate is working. I have the following dummy functions in the .m file (just in case) // called when keyboard search button pressed - (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar { NSLog(@"Search Button Clicked\n"); [theSearchBar resignFirstResponder]; } // called when cancel button pressed - (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar { NSLog(@"Cancel Button Clicked\n"); [theSearchBar resignFirstResponder]; } - (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText { NSLog(@"Search Text So Far: '%@'\n",searchText); } - (BOOL)searchBarShouldBeginEditing:(UISearchBar *)searchBar { return YES; } - (BOOL)searchBarShouldEndEditing:(UISearchBar *)searchBar { return YES; } Why doesn't the Scope Bar appear? A results UIPopoverController appears with the title "Results" and "No results found" (of course) when i type the first character in my search...but no scope bar. (not that i expect anything other than "No Results Found". I am wondering where the scope bar is supposed to appear...in the titleView of the UIPopover? In the toolbar to the right of the search area? Where?

    Read the article

  • iPhone SDK : UIWebView detect link on textfeild !

    - by Momeks
    Hi i create simple web browser for my app and i don't know why when user click a link the address bar doesn't change as link address here is my code : -(IBAction)webAddress:(id)sender { [site loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[webAdress text]]]]; [webAdress resignFirstResponder]; } - (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType { //CAPTURE USER LINK-CLICK. if (navigationType == UIWebViewNavigationTypeLinkClicked) { NSURL *URL = [request URL]; if ([[URL scheme] isEqualToString:@"http"]) { [webAdress setText:[URL absoluteString]]; [self webAddress:nil]; } return NO; } return YES; } what's my problem ?

    Read the article

  • Why does this only work sometimes? (UITextView resign first responder question)

    - by RexOnRoids
    When a user presses the "SEND"(return) button I want the keyboard to retract and do other stuff like send a message. But it only works SOMETIMES... Why does this code only work SOMETIMES? I need it to work all the time obviously, but it doesn't. - (void)textViewDidChange:(UITextView *)inTextView { NSString *text = myTextView.text; if ([text length] > 0 && [text characterAtIndex:[text length] -1] == '\n') { myTextView.text = [text substringToIndex:[text length] -1]; [myTextView resignFirstResponder]; [self sendMessage]; } }

    Read the article

  • KeyboardWillShow with UITextView

    - by Philip J
    Here's the setup: I have a textView (txtReply) where the user puts information I have a UIView that contains a scroll view and some labels, as well as the textView (ChatView) When the user selects the textView, then it brings the keyboard up. I use 'keyboardWillAppear' to move the 'ChatView' up so that the text view is still visible. I then have a reply button that submits the message, draws it into the ChatView, and calls [textView resignFirstResponder]. However, when I do this, it calls the keyboardWillHide, my view resizes, then the it brings the keyboard back up again. Is there something special you have to do to get the keyboard to stay hidden? Thanks

    Read the article

  • UISearchbar clearButton forces the keyboard to appear

    - by DASKAjA
    I have a UISearchBar which acts as a live filter for a table view. When the keyboard is dismissed via endEditing:, the query text and the gray circular "clear" button remain. From here, if I tap the gray "clear" button the keyboard reappears as the text is cleared. How do I prevent this? If the keyboard is not currently open I want that button to clear the text without reopening the keyboard. There is a protocol method that gets called when I tap the clear button. But sending the UISearchBar a resignFirstResponder message doesn't have any effect on the keyboard.

    Read the article

  • Dismissing pickers and keyboards invoked by a UIWebView

    - by Dev Kanchen
    I am implementing an in-app browser using UIWebView, that shows an 'action' button up-top that - when tapped - scales the UIWebView and allows the user to perform some other actions. If, however, at the point of tapping this 'action' button, the user were entering some text on the webview, or using a picker to select an option from a drop-down list, then the webview gets scaled without dismissing the keyboard/picker. Apart from being ugly, this also obscures my main view and controls. So is there a way to make a UIWebView dismiss all associated input controls, such as keyboards/pickers, when asked to? I tried using [myWebView resignFirstResponder] but that didn't work. Any ideas? Thanks.

    Read the article

  • Issues dismissing keyboard conditionally with on iPhone

    - by Chris
    I have an app that has a username and password field. I want to validate the input before the the user is allowed to stop editing the field. To do that, I'm using the textFieldShouldEndEditing delegate method. If the input doesn't validate I display a UIAlertView. This approach works as advertised - the user cannot leave the field if the input doesn't validate. To have the done button on the keyboard dismiss the keyboard, I call resignFirstResponder on the textfield. The issue I have is the alert is being called twice. How do I keep the alert from showing twice?

    Read the article

  • How to make an scrollable UITextField Inside UItableViewCell?

    - by user333624
    Hello everyone. I created a bunch of editable UITableViewCell by embedding an UITextField inside, but I have seen some apps that allows you to scroll the UItableview by scrolling inside an inactive editable cell. How can I do that? And how can I also dismiss the keyboard when tapping somewhere else? I know about the method: - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [[event allTouches] anyObject]; if (touch.tapCount == 1) { [self resignFirstResponder]; } else { }} I put it inside my custom table view controller but the method doesn't seem to be called upon a tap, and I don't know if even if it gets called will dismiss the keyboard. Any help will be appreciated.

    Read the article

  • uitextfield delegate must be file's owner?

    - by deafgreatdane
    I've seen a few references (eg here) in response to folks having trouble getting the keyboard to dismiss in iPhone that say "double check that the delegate is attached to file's owner. Is this necessarily true? Or just standard practice? Can't I have other objects in my nib, such as a subclass of UIViewController, and make connections to those as I like? I'd hate to have to route everything into the object that happens to be file owner. That said, I'm having a difficult time getting the keyboard to disappear. I know it's connected to the delegate, because I can set break points and step through the code. I can see the [theTextField resignFirstResponder] get called (and return true), but the keyboard still won't go away. Any other suggestions?

    Read the article

  • how do I set a delegate in a view that is not my main view

    - by orangecl4now
    I have a xib. the xib has a button that swaps another xib. the second xib has a uitextfield and a uilabel. how do I make the keyboard go away when I'm done typing? what do I need to wire or code? the second xib has it's own class (called CustomSign.m) Inside CustomSign.m, I've implemented the following method -(void)textFieldDidEndEditing:(UITextField *)textField { [customText resignFirstResponder]; signedLabel.text = customText.text; } - (void)awakeFromNib { //assume textField is an ivar that is connected to the textfield in IB [customText setDelegate:self]; } I get the following warning Class "CustomSign" does not implement the UITextFieldDelegate protocol

    Read the article

< Previous Page | 1 2 3  | Next Page >