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 09:49 AM UTC

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 05:27 AM UTC

Dear Support,

Many thanks for your help!

Sincerely,
Sam


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

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



NJ Nathan Jeynes July 22, 2019 03:04 PM UTC

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 12:19 PM UTC

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 12:20 PM UTC

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