uitextfield

Animate a change with NSTextAlignment of UITextField using Swift

岁酱吖の 提交于 2019-12-12 01:56:56
问题 I am curious if it is possible to animate a change in a UITextField's text alignment. Basically I have a UITextField that's alignment is normally set to center, and I want it to animate over to the left when the user starts editing. Here is the code that I've tried within the UITextField Delegate Methods: func textFieldDidBeginEditing(textField: UITextField) { UIView.animateWithDuration(0.5, delay: 0, options: UIViewAnimationOptions.CurveEaseInOut, animations: { self.titleField.textAlignment

How can I perform a check on all check UITextField's in if condition

微笑、不失礼 提交于 2019-12-12 01:44:09
问题 I have been looking out for solutions but haven't found one so far, please refer to the answer to this, i want to know if there is a way i can perform the check on all UITextFields, instead of having a hard coded value, thanks for help. 回答1: first your make sure that all textField have their delegate set to self ( means your viewController) Ex. [myTextField setDelegate:self];// you can also set the delegate in Storyboard or xib directly Then add a instance variable in your class

How to set Horizontal text field in landscape mode with auto layout?

孤街浪徒 提交于 2019-12-12 01:38:44
问题 In my app i want to set text field width according screen size in landscape mode,using auto layout.it's working portrait perfectly in land scape mode not working. Here is my Screen with auto layout, In landscape mode showing like this, Here is my Constraints Screen this my View Controller 回答1: I suppose you must have some superview under this layout that has explicit width set. How does it look like when you tweak simulated metrics like size and orientation in your storyboard? Alse remember

textFieldDidEndEditing not called in a tableview inside a navigation controller

送分小仙女□ 提交于 2019-12-12 01:36:35
问题 I have a tableview controller inside a navigation controller. This table simply shows one textfield in each row. In my navigation controller I have a “Done” navigation item that gets all the values entered in the textfields and shows the next screen. The tableview controller implements UITextFieldDelegte and textFieldDidEndEditing to store the values of every textfield in its datasource (array of strings). In cellForRowAtIndexPath I also assign the delegate of the text fields to themselves.

UITextField shouldChangeCharactersInRange Delegate not working

风流意气都作罢 提交于 2019-12-12 01:05:43
问题 I am having trouble with a new view I have created, I have a registration view that has a single UITextField on it and a UIButton. I call this view from another view like so //otherview.m - (void)viewDidLoad { [super viewDidLoad]; RegistrationAlertViewController *regreg = [[RegistrationAlertViewController alloc] init]; [self.view addSubview:regreg.view]; } Then I create my regregview like this //regregView.h #import <UIKit/UIKit.h> @interface RegistrationAlertViewController : UIViewController

UITextField in UITableViewCell - reuse issue

落爺英雄遲暮 提交于 2019-12-12 00:13:34
问题 I have a UITableView which has a custom UITableViewCell that has a UITextField inside it. Each UITextField displays some text from my viewModel and I am using Reactive-Cocoa to bind the textfields to the viewModel . When my UITableView loads for the first time, everything works just fine. However when I reload the UiTableView for the next 'page' - the first UiTextField on reloaded (page two) tableView has the exact same memory address as the first UITextField in the first 'page' - cell is not

Swift - size of textfield on UIAlertcontrller

孤人 提交于 2019-12-12 00:05:24
问题 I want to increase the initial height of UITextField on UIAlertController. Here is my code: let reportAlertController = UIAlertController(title: "Report", message: "If you find anything to report, please write it in the text box below and press send. To cancel report, press cancel.", preferredStyle: .Alert) reportAlertController.addTextFieldWithConfigurationHandler({ (tf) -> Void in tf.frame.size.height = 1500 tf.placeholder = "Report detail(s) here" }) reportAlertController.addAction

Trying to save data in Core Data from UITableViewController textbox

╄→尐↘猪︶ㄣ 提交于 2019-12-11 20:13:18
问题 I have a Table view controller with 5 textboxes in a row which are added with null values when we click on add button. I am trying to save the data in a database via Core Data. My problem is that when I click in the text box and finish putting the value and via a touch screen when i am trying to put the data the cursor goes to the other text box but do not allow me to enter text until I press the Return key on the keyboard. Here is my coding for the text box: -(void)textFieldDidEndEditing:

how to add UITextField in MKAnnotationView Title

邮差的信 提交于 2019-12-11 19:59:52
问题 I try like this, but it isn't work. How can i do this ? MKAnnotationView *pointTest = [[MKAnnotationView alloc] init]; pointTest.annotation = point; pointTest.draggable= YES; UITextField *pointText = [[UITextField alloc] initWithFrame:CGRectMake(location.latitude, location.longitude, 100, 20)]; pointText.backgroundColor = [UIColor blackColor]; pointTest.rightCalloutAccessoryView = pointText; pointTest.canShowCallout = YES; [self.userMap addAnnotation:pointTest]; 回答1: First of all, you are

Import Google Spreadsheet Cell data to Xcode UITextfield

北城以北 提交于 2019-12-11 19:37:18
问题 Is it possible to Get the data on a specific cell on Google spreadsheet and show it to iOS app Text fields. For Example, this Spreadsheet https://docs.google.com/a/ttttt.us/spreadsheet/ccc?key=0AkgWFqjLQz0TdEJSb3pYem9UcHo1Uzd0SU1QWm5xRFE#gid=0 I have an iOS app that has 2 Text fields. I want to show this Cells on each textfields I have. Everytime that the App opens, or maybe have some interval to refresh if the data in spreadsheet is changed. I hope someone will help me, thank you.! EDIT: i