B4J Question XUI Views - LongTextTemplate gaps in background


Active Member
Licensed User
Longtime User
I have a dialog with text which is too long for which the standard "Show" method.
When I use the following code:
        Dialog.LongTextTemplate.Text = Message
        Wait For (MB_Add.Dialog.ShowTemplate(Dialog.LongTextTemplate, "OK", "", "")) complete
I see the dialog box in the attached file.
I have four problems with this:
  1. I can't see a way to change the dark gray background color of the text.
  2. I can't see a way to change the white text color
  3. I can't see a way to change the white background around the text panel.
  4. I can't see how to make the text panel fill the full width of the dialog box.
What am I missing here? Do I have to create a new template to change the colors? When I look at the LongTextTemplate layout, all I see is a single customlistview panel, with anchors set so it should fill the parent, so it doesn't look as though changing the template would solve problems 3 and 4.


  • xuiview longtexttemplate.PNG
    xuiview longtexttemplate.PNG
    14.8 KB · Views: 149


B4X founder
Staff member
Licensed User
Longtime User
Update to v1.63: https://www.b4x.com/android/forum/threads/b4x-xui-views-cross-platform-views-and-dialogs.100836

Sub Process_Globals
   Private fx As JFX
   Private MainForm As Form
   Private Dialog As B4XDialog
   Private LongText As B4XLongTextTemplate
   Private xui As XUI
End Sub

Sub AppStart (Form1 As Form, Args() As String)
   MainForm = Form1
   Dialog.Title = "B4XDialog Example"
   LongText.CustomListView1.DefaultTextBackgroundColor = xui.Color_White
   LongText.CustomListView1.DefaultTextColor = xui.Color_Black
   LongText.Text = $"js dlkf jskldfj slkdf
sdf kjlsdfj lk jwelrkfj welkfj wlekfj wlkef
wef jlkwe jflkw ejflkwej flkwe jflkwe jflwkef j
we jflkwe jflwek jflkw efjlkwe f

End Sub

Sub MainForm_Resize (Width As Double, Height As Double)
   If Dialog.Visible Then Dialog.Resize(Width, Height)
End Sub

Private Sub MainForm_MouseClicked (EventData As MouseEvent)
   Dialog.ShowTemplate(LongText, "OK", "", "")
End Sub
Upvote 0