If I set SingleLine=true on an EditText widget, I get a single-line edit control that doesn't allow hard returns to be inserted by the user (clicking Enter moves to the next field instead of inserting a new line). If I don't set SingleLine=true, the user can insert hard returns.
If I set layout_height="wrap_content", the EditText control will grow vertically to show all of the text. However, it only does this if SingleLine is not set to true.
So, my question is, is it possible to get the word-wrapping and vertical resizing, without allowing the user to enter hard line breaks? I guess I could trap the enter keypress, but then I would also have to catch other ways they might get one in there (copy/paste, not sure what else?). Is there a simple way to do this with just the right combination of properties?
I prefer the word-wrap where the user can see all of the text, compared to the horizontal scrolling of a single-line edit control, but I don't really want them thinking they can enter multiline text (and I don't want to have to support it). I guess I might just convert hard returns to spaces when I save the data to my database, if I have to (the legacy app I sync this data to on the PC can't handle hard returns).