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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Show Badge on SfTabView

Thread ID:

Created:

Updated:

Platform:

Replies:

142035 Jan 16,2019 06:48 AM UTC Jul 24,2019 12:20 PM UTC Xamarin.Forms 6
loading
Tags: SfTabView
samlin
Asked On January 16, 2019 06:48 AM UTC

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

Dhanasekar R [Syncfusion]
Replied On 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 


samlin
Replied On January 21, 2019 05:27 AM UTC

Dear Support,

Many thanks for your help!

Sincerely,
Sam

Dhanasekar R [Syncfusion]
Replied On January 22, 2019 10:24 AM UTC

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


Nathan Jeynes
Replied On 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

Muneesh Kumar G [Syncfusion]
Replied On 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.  
 
 


Muneesh Kumar G [Syncfusion]
Replied On 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.  
 
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon