uitextfield

drawTextInRect on UITextField not called

I'm trying to implement the answer to this SO question. The problem is: -[drawTextInRect] is apparently not called, and setting the shadow in -[drawRect] doesn't make the UITextField's text shadowed. Another weird thing is that even if my subclass implementations of -[drawTextInRect] and -[drawRect] are completely empty (not even a call...

assign text of a UIlabel to a text field

Hello, I am quite new to iphone development. I have a situation here. I have some labels which can be dragged across the screen. What I want is when any of these labels are dragged to some textfield and released over a textfiels UIlabel test is assigned to that text field. The crux in this is I have to check for a condition when UILab...

implement touchesBegan for UITextField

Hello, Can you catch TextField events when a Touch happens? So far I didn't see the Touch event get registered to TextField. For example, * (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [event allTouches] anyObject; if (touch view == TextFieldView) { do somthing..... } This a dummy code what I wa...

handle touchesBegan method for UITextField in UIScrollView

Hello, I have a situation here, I have to handle touchesBegan for textfield. This textfield is in scrollview. I tried this so far: I made a subclass of UIScrollView @interface CustomScrollView : UIScrollView { } @end @implementation CustomScrollView -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { NSLog(@"good"...

Howto use UITextField's drawTextInRect: method

Hi, I have a UITextField with a custom background, but now i want to change the text's position, so i have to use drawTextInRect:, but i can't figure out how to use it. The documentation says: You should not call this method directly. If you want to customize the drawing behavior for the text, you can override this method to do your dr...

How do I change the UITextField so it looks like the Search Text Field?

I would like to change the standard iPhone UITextField so that it looks exactly like the search text field within the UISearchBar. You can see an example of this for the SMS text entry field within the iPhone Messages application. I do not believe that the UITextField has a style property that will meet this requirement. Any ideas? ...

iPhone UITextField controlling background color

Greetings, I am unable to control the background color of a UITextField with a borderStyle= UITextBorderStyleRoundedRect. With this border style the backgroundColor property only seems to control a very narrow line along the inner edge of the rounded rectangle. The rest of the field remains white. However, if the borderStyle is set t...

Detect backspace in UITextField

Is there any way to detect when the backspace/delete key is pressed in the iPhone keyboard on a UITextField that is empty? I want to know when backspace is pressed only if the UITextField is empty. Based on the suggestion from @Alex Reynolds in a comment, I've added the following code while creating my text field: [[NSNotificationCe...

iPhone Autocomplete

I am creating an iPhone application where I need to display autocomplete functionality for one of the 5 textfield. What could be the best possible way to achieve this. For now I am showing a tableview on the didtextchange delegate method of UITextField. Kindly suggest me better way of doing this. Any suggestion will be appreciated. Tha...

iPhone - UITextView should look like a UITextField

Hello! I need a textfield so an user could write several lines. Unfortunately a UITextField does not provide several lines, so I think I have to use an UITextView. But the design of both are not the same. Is it possible to design the UITextView like the UITextfield standard with white background and rounded corners? Thanks a lot in a...

Objective-C, How can i get the value of a UITextField?

How can i get the value of a UITextField? Some sample code to attach it to an NSString would be fab! P.S - Happy New Year! ...

Objective-C, Set UITextField Value from this:

Hi, I have been told that to access a UITextField in the setup i have with my app, i have to use a subView whatever this is (in a noob at objectivec) and i was given this [subview isKindOfClass:[UITextField class]] Where do i put this? And how can i use it to set the value of my UITextField? :D Thanks! Update: I want to set the valu...

UITextField leftView

Is it possible to set up a UITextField with a leftView so that if a user clicks into the UITextField the keyboard shows but if they click on an icon in the leftView another method is called (i.e., one that displays a UIPickerview)? ...

textField hidding under keyboard in iphone

Hello, I am a newbie in iphone development, I have a view with 10 textfields in it, when I tap on a textfield keyboard appears, this keyboard hides textfields and I was unable to see textfielld while editing. I have seen something in UICatalog which moves corresonding textfield up in the view while editing but unable to follow the cod...

How to get a string from a UITextField?

How would I go about getting a string from a UITextField in the iPhone SDK? I'm trying to insert it into another concatenated string. ...

iPhone Force Textbox Input to Upper Case

How do I force characters input into a textbox on the iPhone to upper case? ...

Multi-line TextField (similar to SMS) and / or 'Done' button in UITextView

Hi all, I've been researching this for a few days now, and would appreciate a little help. Is there any way to generate a multi-line UITextField like Apple use in the SMS application? The useful thing about this control is that it has the 'sunk' appearance that makes it clear that it is a text entry box, but at the same time, it expands...

UITextField apply filter to display

I have some UITextFields for entering currency amounts that display a number pad. In my textFieldDidEndEditing: method I apply a currency nsnumberformatter to the textField.text and update it to display as a currency value. The problem I run into is that once I apply the currency formatter to the inputted number and update the text pro...

Another take on the "keyboard obscures UITextField" problem

Hi All, I know that this is a common problem and the UITableViewController fixed this is iPhone SDK 3.0, but the UITableViewController is not working as I expect, probably due to how I am using it. Here's my problem: I'm working on a form, which is in a grouped table, which contains some text fields. Those on the lower part of the form...

iPhone UITextField filtering doesn't work properly.

Ok, I've run into a small issue here. I'm trying to filter two things in my UITextField. They include limiting the number of characters and filtering the type of characters. I can get each one to work by there self but they both don't work together. It may have something to do with the double returns, idk. Hopefully someone can look at m...