Android Question [Resolved] BCTextEngine resize the runtime view

ivanomonti

Expert
Licensed User
Longtime User
I need to resize object in order to read all the text or not to have white spaces between the title in bold and the text that follows it.


B4X:
Private Sub CreateItem(Width As Int, m As Map) As Panel
    
    Dim p As B4XView = xui.CreatePanel("")
    p.Tag = m
    Dim height As Int = 500
    
    p.SetLayoutAnimated(0, 0, 0, Width, height)
    p.LoadLayout("frame1")
    
    If m.Get("ms_gpt_01_05").As(String).ToLowerCase = "NULL" Then
        Return Null
    End If
    
    Dim s As String
    
    s = "[url]www.miasmart.it[/url] [url]info@miasmart.it[/url]" & CRLF & CRLF
    
    s = s & "[Color=#000000][b]" & m.Get("ms_gpt_01_04").As(String) & "[/b][/Color]" & CRLF
    
    s = s & m.Get("ms_gpt_01_05").As(String).ToLowerCase & CRLF
    
    s = s.Replace("?", "").trim
    
    Dim values As List = Regex.Split("\.",s)
    
    For i =0 To values.Size-2
        If i=0 Then
            s = values.Get(i).As(String) & "."
        Else
            s = s & " " & values.Get(i).As(String) & "."
        End If
    Next
    
    BBCodeView_post.TextEngine = TextEngine
    BBCodeView_post.Text = s
    
    TabMenu1.SetTitle(0,m.Get("love").As(Int))
    TabMenu1.SetTitle(1,"")
    TabMenu1.SetTitle(2,"")
    TabMenu1.SetTitle(3,"")
    
    TabMenu1.SetTextColor(0,xui.Color_Black)
    TabMenu1.SetTextColor(1,xui.Color_Black)
    TabMenu1.SetTextColor(2,xui.Color_Black)
    TabMenu1.SetTextColor(3,xui.Color_Black)
    
    TabMenu1.SetTextSize(0,10)
    TabMenu1.SetTextSize(1,10)
    TabMenu1.SetTextSize(2,10)
    TabMenu1.SetTextSize(3,10)
    
    TabMenu1.SetImage(0,image("love.png"))
    TabMenu1.SetImage(1,image("print.png"))
    TabMenu1.SetImage(2,image("copy.png"))
    TabMenu1.SetImage(3,image("talk.png"))
    
    TabMenu1.setObject(m)
    
    Return p
    
End Sub

 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…