Android Question How i can change text color in RoundSlider by the Code

Alhootti

Member
Hi guys
regarding to my Question how i can change the text color by the code when i Click the button.






TextColor in RoundSlinder:
Sub Button1_Click
    RoundSlider1.mBase.TextColor(0xFFEA0D0D ,Colors.Red)
    ' Not working'
End Sub
 

Attachments

  • SSS.jpg
    SSS.jpg
    80.1 KB · Views: 62

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4X:
RoundSlider1.mBase.GetView(0).TextColor = 0xFFEA0D0D

Tip: when you want to access the internal of these custom views, unzip XUI Views.b4xlib and check the source code.

You will find:
B4X:
Public Sub DesignerCreateView (Base As Object, Lbl As Label, Props As Map)
    mBase = Base
    Tag = mBase.Tag : mBase.Tag = Me
    cvs.Initialize(mBase)
    mMin = Props.Get("Min")
    mMax = Props.Get("Max")
    mValue = mMin
    pnl = xui.CreatePanel("pnl")
    xlbl = Lbl
    xlbl.Visible = True
    mBase.AddView(xlbl, 0, 0, 0, 0) '<---- the label is the first view that is added to mBase. mBase is a panel.
    mBase.AddView(pnl, 0, 0, 0, 0)
    ValueColor = xui.PaintOrColorToColor(Props.Get("ValueColor"))
    mRollOver = Props.GetDefault("RollOver", False)
    If xui.IsB4A Or xui.IsB4i Then
        stroke = 8dip
    Else If xui.IsB4J Then
        stroke = 6dip
    End If
    Base_Resize(mBase.Width, mBase.Height)
End Sub
 
Upvote 0
Top