iOS Question [B4X] [XUI] Msgbox - is there any way to left justify text?

Andris

Active Member
Licensed User
Longtime User
In B4i, Is there any way to left justify [XUI] MsgBox text?
 
Last edited:

Andris

Active Member
Licensed User
Longtime User
There is no such thing [XUI] Msgbox.

Single line? Multiline?
Please post the relevant code.

Sorry for the confusion Erel. In my B4A app I use MsgBoxAsync and MsgBox2Async. There, message text always appears left justified. In creating the B4i version of the app, I'm using the following code to simulate B4A:
B4X:
'(in Process_Globals)
Private mbx As XUI

'(snippet of code)
Dim msg As StringBuilder
msg.Initialize
msg.Append("text text text text texttext text text text text text ")
msg.Append("text text text text texttext text text text text text ")
Dim sf As Object = mbx.MsgboxAsync(msg.ToString,"Title")
Wait For (sf) Msgbox_Result

The message box that appears in iOS is always center justified. So my question is simply whether there's a way to make it left justified.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Now I understand. This is the same as the Msgbox keyword. You cannot change its alignment.

You can use B4XDialog with a light theme and then you will have full control. Example:
B4X:
Sub Process_Globals
    Public App As Application
    Public NavControl As NavigationController
    Private Page1 As Page
    Private Dialog As B4XDialog
    Private xui As XUI
End Sub

Private Sub Application_Start (Nav As NavigationController)
    NavControl = Nav
    Page1.Initialize("Page1")
    Page1.Title = "Page 1"
    Page1.RootPanel.Color = Colors.White
    NavControl.ShowPage(Page1)
    Dialog.Initialize(Page1.RootPanel)
    Dialog.Title = "Example"
    SetLightTheme
End Sub

Sub Page1_Click
    Dim text As String = $"text text text text texttext text text text text text
text text text text texttext text text text text text"$
    Dialog.Show(text, "OK", "", "")
End Sub

Private Sub SetLightTheme
    Dialog.BodyTextColor = 0xFF5B5B5B
    Dialog.OverlayColor = xui.Color_Transparent
    Dialog.BorderColor = xui.Color_Black
    Dialog.BackgroundColor = xui.Color_White
    Dialog.ButtonsColor = xui.Color_White
    Dialog.TitleBarColor = 0xFF007DC3
    Dialog.ButtonsTextColor = 0xFF007DC3
End Sub

B4i_Dd2UmsweG5.png
 
Upvote 0
Top