1. Don't be afraid to check the source code. It is inside the b4xlib(=zip file).
2.
B4X:
Dim rs As Object = Dialog.ShowTemplate(LongTextTemplate, "", "", "Cancel")
LongTextTemplate.CustomListView1.GetPanel(0).GetView(0).SetTextAlignment("TOP", "RIGHT")
Wait For (rs) Complete (Result As Int)
Dim rs As Object = Dialog.ShowTemplate(LongTextTemplate, "", "", "Cancel")
LongTextTemplate.CustomListView1.GetPanel(0).GetView(0).SetTextAlignment("TOP", "RIGHT")
Wait For (rs) Complete (Result As Int)
It crashes: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
Is that because of the internal layout that needs to be loaded.
This below works in changing the font of the label, but does not change the alignment to right:
B4X:
Dim e As B4XView=LongTextTemplate.CustomListView1.DesignerLabel
Dim f As B4XFont =XUI.CreateDefaultBoldFont(28)
e.Font = f
e.SetTextAlignment("TOP", "RIGHT")
Dialog.ShowTemplate(LongTextTemplate, "OK", "", "")
the views are created when calling ShowTemplate (at it returns an object to use for the waitfor). In your code the views are not available at this time.
In that case why does the font change but the alignment does not take effect in this below code. Try it:
B4X:
LongTextTemplate.Text = $"B4X is a great development tool, Manfred is instrumental in making it better."$
Dim e As B4XView=LongTextTemplate.CustomListView1.DesignerLabel
Dim f As B4XFont =XUI.CreateDefaultBoldFont(28)
e.Font = f
Dim rs As Object = Dialog.ShowTemplate(LongTextTemplate, "", "", "Cancel")
e.SetTextAlignment("TOP", "RIGHT")
Wait For (rs) Complete (Result As Int)
1. Don't be afraid to check the source code. It is inside the b4xlib(=zip file).
2.
B4X:
Dim rs As Object = Dialog.ShowTemplate(LongTextTemplate, "", "", "Cancel")
LongTextTemplate.CustomListView1.GetPanel(0).GetView(0).SetTextAlignment("TOP", "RIGHT")
Wait For (rs) Complete (Result As Int)
Thanks. i have a problem with B4XLongTextTemplate. I tested my app on two different devices. There is no problem in one device, but in other device, the text inside the B4XLongTextTemplate is not fully displayed. Where is the problem and how can I fix this problem?