Skip to content

Custom TabBarCellTemplate not working #5

@npagare

Description

@npagare

Hi @stormlion227,

To provide Icon and Badge for a given TabBarCell, I provided following DataTemplate. But instead of seeing an icon and a badge text on the row 0 of the cell and the label Tab 2 on the row 1, I am seeing the output displayed as shown in the screenshot below.
Can you please help me fix this ?

You could also look my previous GitHub issue that can explain my end goal as well.

<stab:STabbedPage.TabBarCellTemplate>
    <DataTemplate>
        <Grid BackgroundColor="PaleVioletRed"
            ColumnSpacing="5">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="20"></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Label Text="Icon"
                Grid.Row="0" 
                Grid.Column="0"
                HorizontalOptions="EndAndExpand"
                VerticalOptions="EndAndExpand"
 	 			HorizontalTextAlignment="Center"
				VerticalTextAlignment="Center"
				/>
            <Label Text="Badge"
                Grid.Row="0" 
                Grid.Column="1"
                HorizontalOptions="StartAndExpand"
                VerticalOptions="EndAndExpand"                       
 	 			HorizontalTextAlignment="Center"
				VerticalTextAlignment="Center"
				/>
            <Label Text="{Binding Title}"
                Grid.Row="1" 
                Grid.ColumnSpan="2"
                HorizontalOptions="Center"
                VerticalOptions="Center"                       
 	 			HorizontalTextAlignment="Center"
				VerticalTextAlignment="Center"
				/>
        </Grid>
    </DataTemplate>
</stab:STabbedPage.TabBarCellTemplate>

image

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions