textfield

Is there a way to dynamically change the Flutter TextField's maxLines?

我只是一个虾纸丫 提交于 2019-11-29 12:45:04
问题 I have a TextField like this: new Flexible( fit: FlexFit.loose, child: new Container( alignment: FractionalOffset.topLeft, child: new TextField( decoration: new InputDecoration( hintText: 'Add a note', ), maxLines: 1, onChanged: (value) => _showSaveOptions(value), ), ), ), I'd like to have my TextField to start out with maxLines set to 1, but as I type, I would like the maxLines to increase, so that all the text remains on the page and I don't have to scroll up. However, I also don't want to

How to get all the textfields from a view in swift

假如想象 提交于 2019-11-29 10:01:47
I have a view which has more than 15 UITextFields . I have to set bottomBorder(extension) for all the UITextFields . I can set it one by one for all the UITextFields and its working too. I want to set the bottom border for all the UITextFields at once. Here is the code I am trying but it seems like that for loop is not executing. I have even tried it in viewDidLayoutSubViews but for loop not executing there too. override func viewDidLoad() { super.viewDidLoad() /** setting bottom border of textfield**/ for case let textField as UITextField in self.view.subviews { textField.setBottomBorder() }

update text field ui in swift ios

不打扰是莪最后的温柔 提交于 2019-11-29 08:16:46
i meet a question when i'm using swift of ios SDK 8 I used a callback to fetch data background and when data fetched, i want to set a text field value and update screen. here is my code: @IBOutlet var txtTest: UITextField! @IBAction func login() { let username = "aaa"; let password = "bbb"; var res = ServiceClient.login(username, password: password){ (res:String, error:String?) -> Void in if(error == nil){ self.txtTest.text = res; } } } Run this code and the data is correctly fetched and the txtTest did not updated, but when i tap txtTest, the value will be shown. So is there any way to force

Javafx textfield resize to text length?

房东的猫 提交于 2019-11-29 07:03:30
Hello guys I am building a chat server where I use a textfield on the screen to type in the chat message that the user writes, the idea is that it works like a bubble over a persons head when he types a message. my question is in order to not make a textbox that is too large or too small is there a way to make the textbox resize (trim if you will) so it adjust to the text written in the textfield? P.S. I'm using JavaFx scenebuilder to do all of this. It is time to do some coding behind the scenes(builder) :). The following code chunk is not a neat solution but better than none. :) // define

Accept only numbers and a dot in Java TextField

六眼飞鱼酱① 提交于 2019-11-29 06:53:24
I've got one textField where I only accept numbers from the keyboard, but now I have to change it as it's a "price textField" and I would also need to accept a dot "." for any kind of prices. How can I change this in order to get what I need? ptoMinimoField = new JTextField(); ptoMinimoField.setBounds(348, 177, 167, 20); contentPanel.add(ptoMinimoField); ptoMinimoField.setColumns(10); ptoMinimoField.addKeyListener(new KeyAdapter() { public void keyTyped(KeyEvent e) { char caracter = e.getKeyChar(); if (((caracter < '0') || (caracter > '9')) && (caracter != '\b')) { e.consume(); } } }); Suresh

Problems with getting text from UIAlertView textfield

…衆ロ難τιáo~ 提交于 2019-11-29 00:16:37
In my application I want a alert with a textfield. After clicking on "Done" I want to save the textfield input in a String. After clicking on "Cancel" I want only to close the alert. I've created my alert like this: var alert = UIAlertView() alert.title = "Enter Input" alert.addButtonWithTitle("Done") alert.alertViewStyle = UIAlertViewStyle.PlainTextInput alert.addButtonWithTitle("Cancel") alert.show() let textField = alert.textFieldAtIndex(0) textField!.placeholder = "Enter an Item" println(textField!.text) The alert looks like this: I want to know how to get the text from the textfield, and

Hide input caret of TextField in JavaFX8

人盡茶涼 提交于 2019-11-28 13:51:24
I would like to hide the input caret of a TextField in JavaFX8. I already tried to set the text fill to white (my TextField has a white background), but then my user input also disappears. The problem is that the textfield still needs focus, so I also thought of some EventHandler which listens to user input, and focusses on the textfield when a key is pressed, but then I would miss the first key typed. Anyone that knows how to do this? Or is it not possible in JavaFX8? jewelsea Update for Java 8u40 A CSS style class was added to JavaFX to switch on and off the text field caret which is (in

Flash AS3: ReferenceError: Error #1056: Cannot create property

▼魔方 西西 提交于 2019-11-28 11:56:59
I am writing something in Flash/ AS3, and I came across this problem: ReferenceError: Error #1056: Cannot create property txtInput on package.name.DocumentClasss Basically I have a document class, and I can create instances of movieclips clips and compile without issues. But when I put a input text field ("T" icon in the palette) on the stage, and it refuses to compile, with the above error. I am not sure if this makes a difference, but I am writing my ActionScript in FlashDevelop, with compilation done in the Flash IDE. I also have both Strict Mode and Warnings Mode selected under Publish

String with numbers and letters to double javafx

坚强是说给别人听的谎言 提交于 2019-11-28 11:44:05
Hi I am trying to read a the numbers from a text field that shows a price e.g. £3.00, and convert the value of the price to a double. Is there a way to do Double value; value = Double.parseDouble(textField.getText()); But it won't let me do that because of the £ sign. Is there a way to strip the pound sign then read the digits. Thanks jewelsea There is some TextFormatter and change filter handling logic built into the JavaFX TextField API, you could make use of that. import javafx.application.Application; import javafx.beans.binding.Bindings; import javafx.geometry.Insets; import javafx.scene

how to localize label strings in ios for a beginner

谁都会走 提交于 2019-11-28 11:33:41
Hi im very much stuck on the process of localisation on ios . heres what i do understand , how to go to the project explorer and set base localizations for diferent countries, how to make a string file and set it to be localized to one of the particular countries chosen within base localisation such as simplified chinese key value pairs and how to correspond the word "HELLO WORLD" = " some other language"; with in the localized string file how ever the app which has a simple label with the writing hello world when compiled doesnt change to chinese in a chinese simulator. heres where i think im