textfield

Flutter textfield that auto expands when text is entered and then starts scrolling the text when a certain height is reached

夙愿已清 提交于 2019-12-18 11:39:46
问题 I've tried many configurations of the Flutter TextField but can't figure out how to build this one. I'm looking for a textfield that is a single line initially and it auto expands as the text is entered into it and then at some point begins scrolling itself. This can be achieved partially by using the maxLines: null attribute. But then when a lot of text is entered the Text in the textfield itself overflows. And if the maxLines is set to a value then the whole textfield itself gets expanded

JavaFX TextField how to prevent key from getting typed in keypressed event

自闭症网瘾萝莉.ら 提交于 2019-12-18 09:05:08
问题 I need to detect the numpad key presses to do some stuff. here is the code: textField.setOnKeyPressed(new EventHandler<KeyEvent>() { @Override public void handle(KeyEvent event) { if(event.getCode().isKeypadKey()) { //do stuff here... event.consume(); } } }); lets say user presses '2' on the numpad, although the event is consumed, the charachter '2' will appear in the textfield. but i dont want that. Any ideas how to prevent this? whats more interesting is that if i throw a dummy exception

Django TextField/CharField is stripping spaces/blank lines

烂漫一生 提交于 2019-12-18 07:35:29
问题 I just researched my "bug" and it turned out to be a new feature in Django 1.9 that CharFields strip spaces by default : https://docs.djangoproject.com/en/1.9/ref/forms/fields/#django.forms.CharField.strip The same seams to apply to text fields. So i found out why Django suddenly behaves differently than before, but is there an easy way to restore the previous default for auto generated admin forms? Id like to NOT strip spaces while still using the auto generated form from the admin. Is that

Input fields rendered very differently in different browsers

故事扮演 提交于 2019-12-18 07:13:07
问题 Okay, so I am in the process of designing a website which has a login form at the top-right corner of a webpage. I set the size attribute of its input fields and I am getting some interesting results. Below is a group of screenshots that I threw together. I even stacked them for you all. I am even throwing in a jsFiddle for you all. So four things: I aligned them based on the bottom right hand corner of the password input field in the stacked image. Don't ask why. I design with borders on

update text field ui in swift ios

天大地大妈咪最大 提交于 2019-12-18 05:12:31
问题 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

Custom Keyboard: inputView: how to change the Keyboard size?

笑着哭i 提交于 2019-12-17 22:55:17
问题 I implemented the textfield with a custom keyboard with the "setInputView" function. But i have a problem: my keyboard frame is not a standard iphone keybord frame. The question is: How can i change the size of my custom keyboard? I know some functions like: UIKeyboardFrameBeginUserInfoKey, ..etc. Please Note: The iPhone keyboard frame is = 0,264,320,216 My custom keyboard frame is = 0,0,320,460 Hoping for your kind collaboration, Best regards... P 回答1: It turns out that the default behaviour

iOS multiple text fields on a UIAlertview In IOS 7

爷,独闯天下 提交于 2019-12-17 19:36:37
问题 So the new iOS 7 has come out and I'm trying to add multiple textFields and labels to the UIAlertviews. I need three. I've been trying to add them as subviews and that doesn't work anymore. I have also tried to add multiple lines with the UIAlertViewStylePlainTextInput but it only seems to return one text field. I need to add in labels to show them what to enter as well. Is there a way to accomplish this task with the new iOS 7? 回答1: The only solution i found using UIAlertView with more than

JavaFX Textfield with listener gives: “java.lang.IllegalArgumentException: The start must be <= the end”

谁说胖子不能爱 提交于 2019-12-17 18:47:06
问题 i am getting an exception and don't understand what causes it. It's an FX App with FXML files. At the init() part of the App i add a listener to a textfield which calls a function that monitors the String with a regex for a pattern. tf.textProperty().addListener( (observable, oldValue, newValue) -> { handleInput(newValue); }); the function: private void handleInput(String s) { s = s.toUpperCase(); Matcher matcher = Pattern .compile( "^[A-Z]{2}(20|21|22|23|[0-1]\\d)[0-5]\\d(20|21|22|23|[0-1]\

JFormattedTextField with MaskFormatter

≡放荡痞女 提交于 2019-12-17 11:45:09
问题 I have a JFormattedTextField that I use to restrict entries of a date and time. I want to use a MaskFormatter though to show the placeholder chars. Is there a way to use a MaskFormatter on top of the JFormattedTextField when the text field is already using a SimpleDateFormat ? Thanks, Jeff 回答1: public class MaskFormatterTest { private static final DateFormat df = new SimpleDateFormat("yyyy/mm/dd"); public static void main(String[] args) { JFrame frame = new JFrame(""); frame

Customizing Increment Arrows on Input of Type Number Using CSS

こ雲淡風輕ζ 提交于 2019-12-17 06:27:43
问题 I have an input of type number that is rendered using the following code: <input class="quantity" id="id_form-0-quantity" min="0" name="form-0-quantity" value="1" type="number"> It looks like this: I would like to turn it into something like this: The second view is emulated using two separate buttons. How could I style the arrows as described? 回答1: The native input[type=number] controls are not style-able cross-browser. The easiest and safest way to achieve what you want cross-browser/cross