What I want to achieve:
1. The text area height to be increased to accommodate 2 lines of text
2. Enable Text wrapping
3. All text entered should be visible
4. The text field is as wide as the activity width.
Problems I'm facing:
1. There is some blank space above the text
2. Not all text entered are visible
3. The width of the input template is much shorter than that of the dialog.
Note: The max 200 chars limit is not written in stone. All I want is to be able to enter some text longer than the default input template can accommodate with word wrapping enabled.
Could someone show me what I did wrong, please?
TIA
1. The text area height to be increased to accommodate 2 lines of text
2. Enable Text wrapping
3. All text entered should be visible
4. The text field is as wide as the activity width.
Problems I'm facing:
1. There is some blank space above the text
2. Not all text entered are visible
3. The width of the input template is much shorter than that of the dialog.
Note: The max 200 chars limit is not written in stone. All I want is to be able to enter some text longer than the default input template can accommodate with word wrapping enabled.
Could someone show me what I did wrong, please?
TIA
To show two lines of text with wrapping enabled:
Activity.LoadLayout("Layout")
Dialog.Initialize(Activity)
inputTemplate.Initialize
Dialog.Title="Please enter text"
rs=Dialog.ShowTemplate(inputTemplate, "OK", "", "CANCEL")
Dialog.Base.Width=Dialog.Base.Width * 2
Dialog.Base.Top=0
Dialog.Base.Left=0
Dim bft As EditText 'B4XFloatTextField
bft=inputTemplate.TextField1
bft.Width=Activity.Width
bft.Height=bft.Height * 2
bft.Wrap=True
bft.TextColor=xui.Color_Magenta
inputTemplate.lblTitle.Text="Max 200 characters"
Wait For (rs) Complete (Result As Int)
If Result = xui.DialogResponse_Positive Then
Dialog.Show($"You entered: ${inputTemplate.Text}"$, "OK", "", "")
End If