-
Hello how can I get a single-line input text field to wrap? Right now it just stays a fixed size, but I'd like the dialog (or the input field) to increase height as more text gets entered. I think I'm just not familiar with styling enough to understand what to do. Here's what I tried. In my <style name="MyCustomDialogTheme" parent="ThemeOverlay.MaterialComponents.Dialog.Alert">
<item name="textInputStyle">@style/MyTextInputStyle</item>
</style>
<style name="MyTextInputStyle">
<item name="android:layout_height">wrap_content</item>
<item name="singleLine">true</item>
<item name="maxLines">6</item>
<item name="android:textSize">16sp</item>
</style> Then in the code SimpleFormDialog.build()
.theme(R.style.MyCustomDialogTheme)
.pos(R.string.ok)
.neg(R.string.cancel)
.title(R.string.annotation_edit_button_label)
.fields(
Input.plain("annotations")
.text("Lorem ipsum dolor sit amet, consectetur adipiscing elit")
).show(); But it doesn't wrap, and the dialog appears strange, the OK/Cancel and hint text become very small. I did look at the Wiki but when I try to add a parent to the text input style,
The application just crashes. Expand to see stack trace
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
You can just set the multiline input type: SimpleFormDialog.build()
.title("Multiline input")
.fields(
Input.plain("key").inputType(InputType.TYPE_TEXT_FLAG_MULTI_LINE)
) |
Beta Was this translation helpful? Give feedback.
You can just set the multiline input type: