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

Show Badge on SfTabView

Dear Support,

Is there any solution for showing badge on SfTabView like attachment ?

I tried to use SfBadgeView but not success...


Sincerely,
Sam

Attachment: badgeOnSFTabView_5bd0b744.rar

6 Replies

DR Dhanasekar R Syncfusion Team January 17, 2019 04:49 AM

Hi Salim, 
 
Greetings from Syncfusion. 
 
We have prepared a sample to add a badge view on the SfTabView HeaderContent, please have the sample for the same from the link given below. 
 
Sample linkTabViewSample 
 
In this sample we have used label and frame to get the badge view layout on the header content of SfTabItem. 
 
Code snippet
 
 <tabView:SfTabItem.HeaderContent>
     <Grid>
        <Grid.ColumnDefinitions>
              <ColumnDefinition Width="8*" />
              <ColumnDefinition Width="2*" />
        </Grid.ColumnDefinitions>
        <Label Text="Completed" TextColor="#FF00AFF0" FontSize="16" VerticalOptions="Center" HorizontalOptions="Center" />
             <Grid HeightRequest="20" WidthRequest="20" VerticalOptions="Center" Grid.Column="1" HorizontalOptions="Center">
                <Grid VerticalOptions="Center" HorizontalOptions="Center">
                      <Frame CornerRadius="10" BackgroundColor="Red" HasShadow="false" />
                 </Grid>
              <Label Text="21" TextColor="White" FontSize="14" HorizontalTextAlignment="Center" VerticalOptions="Center" HorizontalOptions="Center" />
              </Grid>
     </Grid>
  </tabView:SfTabItem.HeaderContent> 

Output image:

 
 
 
Regards, 
Dhanasekar 



SA samlin January 21, 2019 12:27 AM

Dear Support,

Many thanks for your help!

Sincerely,
Sam


DR Dhanasekar R Syncfusion Team January 22, 2019 05:24 AM

Hi Sam, 
 
Thanks for the update. Please get back to us if any further assistance. 
 
Regards, 
Dhanasekar 



NJ Nathan Jeynes July 22, 2019 11:04 AM

Is there any way to add this to the default display type of  "Image with text" or can you provide the view you use to create this so we can use and tweak it with the badge on the image? 

Its quite a common thing it would be great to see SfTabView contain badge text as standard

Nathan


MK Muneesh Kumar G Syncfusion Team July 24, 2019 08:19 AM

Hi Nathan, 
 
We have validated your query and created sample based on your requirement. Please find the sample from below link. 
 
Sample Link: 
 
In this sample, we have added Image and Label as a header content and used SfBadgeView control to display the badge over the image. 
 
Please refer the below code snippet for this. 
 
 <tabView:SfTabItem.HeaderContent> 
                    <StackLayout   Orientation="Vertical"> 
                        <badge:SfBadgeView  BadgeText="8"> 
                            <badge:SfBadgeView.Content> 
                                <Image Aspect="AspectFit"   HeightRequest="30" WidthRequest="30" Source="Compose.png"></Image> 
                            </badge:SfBadgeView.Content> 
                            <badge:SfBadgeView.BadgeSettings> 
                                <badge:BadgeSetting BadgeType="Error"  Offset="-31,1" BackgroundColor="Red" /> 
                            </badge:SfBadgeView.BadgeSettings> 
                        </badge:SfBadgeView> 
                        <Label Text="Archive" TextColor="#FF00AFF0" FontSize="16" VerticalOptions="Center" HorizontalOptions="Center" /> 
                    </StackLayout> 
                </tabView:SfTabItem.HeaderContent> 
 
Please refer below link for reference 
 
 
We request you to try our sample, If your requirement is different from this could you please share more detail about your requirement or video or screen shot for this. 
 
This will be helpful for us to provide you a good solution and improve us to serve you better. 
 
Regards,
Muneesh Kumar G.  
 
 



MK Muneesh Kumar G Syncfusion Team July 24, 2019 08:20 AM

Hi Nathan, 
 
We have validated your query and created sample based on your requirement. Please find the sample from below link. 
 
Sample Link: 
 
In this sample, we have added Image and Label as a header content and used SfBadgeView control to display the badge over the image. 
 
Please refer the below code snippet for this. 
 
 <tabView:SfTabItem.HeaderContent> 
                    <StackLayout   Orientation="Vertical"> 
                        <badge:SfBadgeView  BadgeText="8"> 
                            <badge:SfBadgeView.Content> 
                                <Image Aspect="AspectFit"   HeightRequest="30" WidthRequest="30" Source="Compose.png"></Image> 
                            </badge:SfBadgeView.Content> 
                            <badge:SfBadgeView.BadgeSettings> 
                                <badge:BadgeSetting BadgeType="Error"  Offset="-31,1" BackgroundColor="Red" /> 
                            </badge:SfBadgeView.BadgeSettings> 
                        </badge:SfBadgeView> 
                        <Label Text="Archive" TextColor="#FF00AFF0" FontSize="16" VerticalOptions="Center" HorizontalOptions="Center" /> 
                    </StackLayout> 
                </tabView:SfTabItem.HeaderContent> 
 
Please refer below link for reference 
 
 
We request you to try our sample, If your requirement is different from this could you please share more detail about your requirement or video or screen shot for this. 
 
This will be helpful for us to provide you a good solution and improve us to serve you better. 
 
Regards,
Muneesh Kumar G.  
 
 


Loader.
Live Chat Icon For mobile
Up arrow icon