iOS Question (Solved) Show a Default Text in SignatureTemplate when Dialog Box Opens in B4i

Alex_197

Well-Known Member
Licensed User
Longtime User
Hi all.

I'm trying to add a default in SignatureTemplate when Dialog Box Opens like a Please sign here. Here is a code

B4X:
Private Sub Hint
    Try
        '        '    'Alex 06/18/2025
        SignatureTemplate.Resize(Base.Width*0.90,Base.Height*0.6)
   
       
        Dim lbl As Label
        lbl.Initialize("")
       
   
        Dim sw,sh As Int
   
        sw=Base.Width /3.5
        sh=Base.Height*0.25
   
        Log(sw & TAB & sh)
   
       
        SignatureTemplate.mBase.AddView(lbl, sw, sh, 150dip, 50dip)
   
        lbl.Multiline=False
           
        'lbl.Text = "Signature here:"
        'lbl.TintColor=Colors.LightGray
       
        Dim cs As CSBuilder
        cs.Initialize
        cs.Font(Font.CreateNew(25)).Append("Sign Here").Pop.Color(Colors.LightGray).Pop
        lbl.AttributedText=cs

    Catch
        Log("Hint " & LastException.description)
        Main.modfun.ShowError("ClockOut_Hint " & LastException.description)
    End Try
End Sub

It works fine. The only problem I can't change the color of this text to LightGray. It's black and the user gets confused where to sign. The reason I'm using a CBuilder is because of this (code from B4A)

B4X:
'Alex 06/18/2025
        SignatureTemplate.Resize(Base.Width*0.90,Base.Height*0.6)
        'SignatureTemplate.AddDateAndTime = false
        Dim lbl As Label
        lbl.Initialize("")
       
        Dim sw,sh As Int
   
        sw=Base.Width /10
        sh=Base.Height*0.3
   
        Log(sw & TAB & sh)
   
        SignatureTemplate.mBase.AddView(lbl, sw, sh, 200dip, 1000dip)
   
        lbl.SingleLine=True
        lbl.TextSize=30
   
        lbl.Text = "Signature here:"
        lbl.TextColor=Colors.LightGray

In B4i there is no property TextSize for a label and it's comes up very small.

Any ideas how to specify a color for this text?

Thank you
 
Last edited:

Alex_197

Well-Known Member
Licensed User
Longtime User
This is the answer
B4X:
ate Sub Hint
    Try
        '        '    'Alex 06/18/2025
        SignatureTemplate.Resize(Base.Width*0.90,Base.Height*0.6)
    
        
        Dim lbl As Label
        lbl.Initialize("")
        
    
        Dim sw,sh As Int
    
        sw=Base.Width /3.5
        sh=Base.Height*0.25
    
        Log(sw & TAB & sh)
    
        
        SignatureTemplate.mBase.AddView(lbl, sw, sh, 150dip, 50dip)
    
        lbl.Multiline=False       
        lbl.TextColor=Colors.LightGray
        
        Dim cs As CSBuilder
        cs.Initialize
        cs.Font(Font.CreateNew(25)).Append("Sign Here").Pop'.Color(Colors.Yellow).Pop
        lbl.AttributedText=cs

    Catch
        Log(LastException)
    End Try
End Sub
 
Upvote 0
Top