uitextfield

iPhone SDK - UITextField subview of UITableCell gives drawing issues?

I'm adding some UITextFields, UITextViews and UIImageViews as subviews to a UITableCell. When I'm entering some text to the TextFields or TextViews and scroll the table up or down, I get some drawing issues. The text of every second field overlaps other fields like this: I'm creating the form elements like this: self.formFields =...

UIKeyboardTypeNamePhonePad auto capitalization

I am using a UIKeyBoardTypeNamePhonePad to allow entry of just letters and numbers. It is missing some functionality that I need. First, I need all the letters that are typed to be capitalized. I can just change it as it enters the text view, but I don't want the user to be confused on how to enter capital letters. Also, I want the n...

Clear button color on text field

How do you change the clear button color of a UITextField? ...

Customized Auto-completion in XCode development

Is there a way for me to create a UITextView/UITextField* that on getting the latitude and longitude of the current location the texf field is autofilled automatically. I don't want to use Google Maps database, I already have my own that is customised that contains 1,265 entries. On getting a location that is not in the database, the...

sizeWithFont doesn't give correct height for UITextView if there is a long string in the text being wrapped

Is there a way to get the correct size of an NSString using: - (CGSize)sizeWithFont:(UIFont *)font forWidth:(CGFloat)width lineBreakMode:(UILineBreakMode)lineBreakMode that doesnt get thrown off by 2 or 3 hundred character strings. At the moment if I try to use this method on these long strings it incorrectly calculates them and I end...

UITextField: Text Entered Programmatically but not Visible in the Text Field

I have a weird behaviour that has only shown up in the last week. I don't use IB, all the controls are created in code. I have a text field with a keyboard active. The first time I load the text field and use the keyboard, everything works normally. The second time I use it, the typed text does not show in the text field. However, the t...

Can I programmatically fire the "switch to number pad" button on iPhone keyboard

I want to find a way to programmatically fire the selector that causes the iPhone keyboard to switch from letters to numbers. I am aware that I can switch the keyboard type, but I want to know if there is a way to do this without switching the keyboard type. ...

How to change the baseline of an UITextField ?

How would you change the baseline of any text entered in a UITextField? ...

Calculator application, pupulating textfield from buttons, iphone

I am creating a simple calculator application. I have 10 buttons labelled 0 through 9, and 5 buttons for the operations. I have an uitextfied which should be populated from the buttons. ie when the user click button 1, 1 should be entered in the field and so on. Also the value entered should be there even if the user taps another one. ho...

How to use NSNumberFormatter for currency to print in UITextField

Hey Guys , I am a N00b here . I print my currency like this : -(IBAction)buttonPressed1:(id)sender { double currency = [Amount1.text doubleValue] + [Amount2.text doubleValue]; SumCurrency.text = [NSString stringWithFormat:@"%0.0f", answer]; } I just simply want to use NSSNumberFormatter to print the SumCurr...

Decimal amount from UITextField to Core Data integer field

Hi all, I have a UITextField in my app that accepts decimal amounts for prices (i.e., 123.45). This field is stored in Core Data as an integer. The code I have that doesn't work is: [self.managedObject setValue:[textField floatValue]*100 forKey:@"price"] And I can't quite figure out how to make this work. Any ideas? Thanks! ...

Using NSNumberFormatter to format currency in output UILabel

NSNumberFormatter * fmt; NSNumber * n; fmt = [ [ NSNumberFormatter alloc ] init ]; n = [ NSNumber numberWithFloat: 10 ]; [ fmt setFormatterBehavior: NSNumberFormatterBehavior10_4 ]; [ fmt setCurrencySymbol: @"$" ]; [ fmt setNumberStyle: NSNumberFormatterCurrencyStyle ]; // NSLog( @"%@", [ fmt stringFromNumber: n ]; [ fmt ...

Re-Apply currency formatting to a UITextField on a change event

Howdy all, I'm working with a UITextField that holds a localized currency value. I've seen lots of posts on how to work with this, but my question is: how do I re-apply currency formatting to the UITextField after every key press? I know that I can set up and use a currency formatter with: NSNumberFormatter *currencyFormatter = [[NSN...

iPhone perform action when UITextField / UISearchBar's clear button is pressed.

Hi, Is it possible to gain access to a delegate method that will allow additional actions to be performed when the "clear" button is pressed on a UITextField / UISearchBar? Thanks ...

How do I make the modal view only come up half way?

So I have an app where you play a game, and at the end it asks you your name for recording of the high score. I would like to use a modal view to accomplish this, but I am experiencing some hiccups along the way. So far, all I have is the modal view sliding up all the way to the top of the screen, but there isn't anything there yet, it's...

Detect what's being inputed in a UITextField

Hi. I have a UITable View with a textfield that is editable right on the view (like Phone in contacts, etc.). I want to enable/disable my save button conditional up text being present in this field. So, I want the button to start out as disabled (for a new record) and then, as soon as I type the first letter into my text field, I want t...

iPhone UITextField - Show Magnify Callout Programatically

I have created a subclass of UITextField that stores a number. By overriding touchesMoved: I have created the functionality so sliding left and right on the UITextField changes the number value. What I would like is to programmatically display a magnifying glass over the UITextField- similar to the one Apple provides when editing the t...

Custom UITextField blurred text

When a UITextField with custom frame (200 54 px) loses focus, the text looks a little bit blurry. example screenshot Is this a common problem? Any workaround / solution or am I doing something wrong? ...

How to emulate bottom alignment in a UITextField

I would like to have a UITextField which aligns to the bottom and to the right. I would like the majority of text to be on the bottom line with putting extra words on the next line as needed. I have been messing around with different layoutSubviews implementations to achieve this functionality. However, the text always fills the top l...

becomeFirstResponder not working!!!

In the below code becomeFirstResonder not working, only resignFirstresponder working...can anyone please help - (BOOL)textFieldShouldReturn:(UITextField *)textField { if (textField == txtDate) { [txtDate resignFirstResponder]; [txtTime becomeFirstResponder]; } if (textField == txtTime) { [txtTime resignFirstResponder]; [txtAddress be...