We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Tab header customization

Hi,

I want to know if the following header customization is possible using sftabview.

I am loading n number of tabs with scroll enabled, each tab loads a sf chart, all binded to the same data source and refreshed on tab index changed.

I want to change the tab header color, say red or green, based on the tab content i render on tab click - but the catch is i want to pre-load the tab color before moving to the particular index so that i go and click the tabs which are only red. Is there any way to achieve this using sftabview?

Thanks,
Ramesh 

1 Reply

MK Muneesh Kumar G Syncfusion Team May 31, 2019 10:35 AM UTC

Hi Ramesh, 
 
We have validated your query, you can achieve your requirement by using OnAppearing override method as per the below code snippet. 
 
Code Snippet: 
protected override void OnAppearing() 
        { 
            base.OnAppearing(); 
            foreach (var tabItem in tabView.Items) 
            { 
                if (tabItem.Content is StackLayout) 
                { 
                    tabItem.TitleFontColor = Color.Red; 
                    tabItem.SelectionColor = Color.Red; 
                } 
                else 
                { 
                    tabItem.TitleFontColor = Color.Green; 
                    tabItem.SelectionColor = Color.Green; 
                } 
            } 
        } 
 
Here we set the title color & selection color of the tab based on the tab item content. Please find the sample from below link. 
 
 
We request you to try our sample. If your requirement different from this, please provide us more details about your requirement or modify the sample above and send it back to us.  
 
Regards, 
Muneesh Kumar G. 


Loader.
Up arrow icon