The text color changing in Tabs title

43 views
Skip to first unread message

DogPlanner GSS

unread,
Dec 10, 2025, 4:49:32 AM (4 days ago) Dec 10
to DroidScript
Dear Developers,

Could you tell us pls is it possible to change the color of Tabs titles.
We created the following Tabs:

tabs = app.CreateTabs("tab1, tab2, tab3", 1, 1, "VCenter");
tabs.SetOnChange( tabs_OnChange );
lay.AddChild( tabs );

As a result tab1   tab2    tab3 are displayed in light grey colors and it is hard to see if the color of background is the same.

Thank you very much in advance.

Alan Hendry

unread,
Dec 10, 2025, 1:16:57 PM (4 days ago) Dec 10
to DroidScript
HI,
I can't see any Methods to change TextColor of tabs.
Themes don't seem to have an effect
Not sure what AdjustColor does
Previously I wrote my own tabs.
There's also Hybrid
Regards, Alan H

function OnStart() {
lay = app.CreateLayout( "linear", "" )

    var theme = app.CreateTheme("dark")
    theme.SetBackColor( "red" )
    theme.SetBtnTextColor( "green" )
    theme.SetTextColor( "green" )
    theme.SetTitleColor( "green" )
    theme.SetDialogBtnColor( "green" )
    theme.SetDialogBtnTxtColor( "green" )
    theme.SetDialogColor( "green" )
    theme.SetHighlightColor( "green" )
    theme.SetListDividerColor( "green" )
    theme.SetProgressBackColor( "green" )
    theme.SetProgressTextColor( "green" )
    theme.AdjustColor( -76 )
    app.SetTheme( theme )
 
var tabs = app.AddTabs( lay,"fade,Tab 2", 0.3, 0.3, "fade" )
tab1 = tabs.GetLayout( "fade" )
tab2 = tabs.GetLayout( "Tab 2" )
tabs.AdjustColor(-76)

var tabs2 = app.AddTabs( lay,"nomargins,Tab 4", 0.3, 0.3, "nomargins" )
tab3 = tabs2.GetLayout( "nomargins" )
tab4 = tabs2.GetLayout( "Tab 4" )

var tabs3 = app.AddTabs( lay,"no options,Tab 6", 0.3, 0.3, "" )
tab5 = tabs3.GetLayout( "no options" )
tab6 = tabs3.GetLayout( "Tab 6" )

app.AddLayout( lay )
}




//


DogPlanner GSS

unread,
Dec 11, 2025, 5:33:20 AM (3 days ago) Dec 11
to DroidScript
Dear Alan,

Thank you very much! It helped. But one more problem appears:

    var theme = app.CreateTheme("dark")
    theme.SetBackColor( "red" )
    theme.SetBtnTextColor( "green" )
    theme.SetTextColor( "green" )
    theme.SetBackground("Img/_storage_emul......")
    app.SetTheme( theme );

We inserted the SetBackground line in theme and now when launching the app background picture appears for a 1 second and then dark of light backgound (depending on choosed type of theme) set in.

It isn't clear what a problem? Could you pls see is it our error or something else?

Thank you very much in advance.

Have a nice day.

Best regards
Dmitry

среда, 10 декабря 2025 г. в 21:16:57 UTC+3, hendr...@gmail.com:

Alan Hendry

unread,
Dec 11, 2025, 8:21:12 AM (3 days ago) Dec 11
to DroidScript
HI,
On the control there's SetBackGround
Setting in Theme only seems to affect Layout appearance 
         SetBackground:["/Sys/Img/Droid1.png"]
Regards, Alan H

DogPlanner GSS

unread,
Dec 12, 2025, 9:43:40 AM (2 days ago) Dec 12
to DroidScript
Dear Alan,

thank you very much for help! We figured it out in this question somehow:))
Below you can see the solution - we can do background image as tabs layout background:

function OnStart() {

    lay = app.CreateLayout("linear", "VCenter, FillXY");

    var theme = app.CreateTheme("light")
    theme.SetTextColor( "blue" )
    app.SetTheme( theme );

    var tabs = app.CreateTabs("tab1, tab2, tab3", 1, 1, "VCenter");
    tabs.SetOnChange( tabs_OnChange );
    lay.AddChild( tabs );

    layTab1 = tabs.GetLayout("tab1");
    layTab1.SetBackground("Img/IMG...");
    btn = app.CreateButton("Button");
    layTab1.AddChild( btn );

    layTab2 = tabs.GetLayout("tab2");
    layTab2.SetBackground("Img/IMG...");

    layTab3 = tabs.GetLayout("tab3");
    layTab3.SetBackground("Img/IMG...");

    app.AddLayout( lay );
}

function tabs_OnChange( name ) {

    app.Showpopup( name );
}

So all work! Thank you very much for help!

Have a nice day.

Best regards
Dmitry

четверг, 11 декабря 2025 г. в 16:21:12 UTC+3, hendr...@gmail.com:
Reply all
Reply to author
Forward
0 new messages