uitextfield

iPhone: How can I make a UITextField invisible but still clickable?

匿名 (未验证) 提交于 2019-12-03 09:06:55
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: What I'm trying to do: In a simple UITableView, I've got a form with both text and dates/times that can be edited. I'm using UITextFields in the date/time cells too, so that the inputView property can be used to display a datePicker over the keyboard. What the problem is: The problem with this is that these UITextFields are really just dummy fields that show a datePicker when selected. When they're selected, they show this annoying blue cursor that blinks - but these are just dummy text fields, and I don't want them to become visible at all.

Disable Keyboard for UITextfield

匿名 (未验证) 提交于 2019-12-03 08:57:35
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm wondering how to disable the inputview of a UITextfield. Setting textField.inputView = nil; or [textField setInputView:nil] in ShouldBeginEditing doesn't do anything, and using the userInteraction property removes the ability to interact with the field. Ideally, I'd like to remove both the cursor and the keyboard while still being able interact with and switch between textfield methods, using ShouldBeginEditing and ShouldEndEditing. Is there any way to accomplish this? 回答1: You should do this: myTextField.inputView = UIView.new; //Empty

UITextField ― Adding UIView for leftView - Can't get Focus

匿名 (未验证) 提交于 2019-12-03 08:57:35
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: The UITextFields in my app have placeholder text defined (in Interface Builder), and I cannot cause these fields to acquire focus (i.e. show the keyboard and allow editing) when I tap on the area occupied by the placeholder text. If I tap on the textfields in an area just outside the that of placeholder text (though still within the bounds of the textfiled itself), it acts as normal (i.e. the keyboard pops up and I can edit the content of the textfield). How can I fix this? Thanks. EDIT 1 Ok, I think I've got it. I'm also setting a

How to test UITextField in Xcode UI Testing when the text field is empty?

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am making a UITest in Xcode. When I record my test it works fine but when I run the test, it gives an error. These are the lines of code where the error occurs: XCUIElement *clearTextTextField = [app.textFields containingType:XCUIElementTypeButton identifier:@"Clear text"].element; [clearTextTextField typeText:@"sheffield"]; The error says UI Testing Failure - No matches found for textfield I imagine this is because my Text Field does not have any initial string and the tester cannot find a text box with initial string "Clear Text" . I

UITableView with UITextField - keep the data even after user scrolls

匿名 (未验证) 提交于 2019-12-03 08:50:26
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a UITableView and it has bunch of UITableViewCells - These UITableViewCells have multiple UITextFields inside it. Now every time I scroll up and down - and the UITableViewCells go out of the view - and comes back in whatever text I enter inside the UITextField disappears - What is the best way to make this work? 回答1: create an NSMutableArray which at each position, holds an NSString object which matches each cell. when you config + show each cell in - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:

UITapGestureRecognizer on UITextField no longer works in IOS 7.1

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a UITapGestureRecognizer attached to a UITextField to get a "drop down" like effect. When the UITextField is tapped, I present a UIPopover with the content. This worked like a charm pre 7.1 - Now the UITextField just becomes first responder, and the gesturerecognizer is totally ignored. Tried setting delaysTouchedBegan to YES but it didn't help.Any help? 回答1: Why to use UITapGestureRecognizer , better to use UITextFieldDelegate methods - (BOOL)textViewShouldBeginEditing:(UITextView *)textView{ //Do what you need to do... } OR You can

How can I enable the UITextField to have only one text/number and navigate through multiple `UITextField`s using Next / Done Button

梦想的初衷 提交于 2019-12-03 08:46:46
I have to handle navigate through multiple UITextField s using (Next / Done Button) and now I have to allow only one text/number in each UITextField how could we do that in UITextField as shown in image below I have used following code recently and was able to achieve too but got problem that When I first enter the text/number in UITextField it is being entered in UITextField and when I enter the next text/number for second time it is being used only to push to next UITextField . I want to achieve is that when i enter the text/number for second time it must be pushed to next UITextField as

How to get UITableViewCell's index from its edited UITextField

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm working on an iPhone based BI project. I have a UITextField in a UITextViewCell , the UITextFieldDelegate points to my UITableViewController , I haven't done any sub-classing for the UITextViewCell nor the UITextField . Now after the text field end editing on the delegate -( void ) textFieldDidEndEditing :( UITextField *) textField I need to know the row index of the current cell I'm editing, is there any way to get the parent cell of the text field? Or can I set some property to the textfield like 'rowIndex' when I create the

UITextField autocapitalizationType UITextAutocapitalizationTypeAllCharacters not working on device

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: You can set the autocapitalizationType property of a UITextField so all input is in upper case. I find that does work fine on the simulator (when actually tapping the simulator's keypad, not the Mac's keyboard), but not on the device? Everything stays lowercase. In the UICatalog demo I added to the textFieldNormal method: textFieldNormal.autocapitalizationType = UITextAutocapitalizationTypeAllCharacters; Added a delegate too, to display the actual autocapitalizationType for the UITextField: - (void)textFieldDidBeginEditing:(UITextField *

UITextField keyboard doesn't appear

匿名 (未验证) 提交于 2019-12-03 08:44:33
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a very simple screen with an UITextField with the default configuration, nothing special. When I touch the UITextField, the keyboard doesn't pops up. I haven't any custom control, behavior or anything else, just that, but it doesnt'work. I've done this in previous apps iPhone/iPad apps already on the AppStore but i can't figure out what's going wrong here. The UITextField is created in Interface Builder, in the nib file. I've been doing some research and i added an IBAction in the UIViewController for UItextField TouchDown