Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WP8: reduce the pivot page header size?

I need to reduce the header text item1 in pivot page. But, i dunno how to do. Is there anyway to reduce this font size ?

XAML Code;

<phone:PivotItem Header="item1">
            <Grid/>
        </phone:PivotItem>
like image 390
Mohamed Thaufeeq Avatar asked Dec 20 '22 01:12

Mohamed Thaufeeq


2 Answers

You can change HeaderTemplate. Smth like this:

<phone:Pivot.HeaderTemplate>
    <DataTemplate>
        <Grid>
             <TextBlock Text="{Binding}" FontSize="40" />
        </Grid>
    </DataTemplate>
</phone:Pivot.HeaderTemplate>
like image 173
Chepene Avatar answered Jan 27 '23 04:01

Chepene


You cannot change the font size in PivotItem. Instead you can create a Template where you can add a TextBlock and consider it as a header. Please find the sample here.

<controls:Pivot Title="whatever" Name="pivot">
    <controls:PivotItem Margin="11,28,13,0" >
        <controls:PivotItem.Header>
            <Grid>
                <TextBlock Name="FirstPivot" FontSize="31" Text="FirstPivot" />
            </Grid>
        </controls:PivotItem.Header>
        <Grid>    <!-- content --> </Grid>
</controls:Pivot>
like image 36
Vijay.P Avatar answered Jan 27 '23 02:01

Vijay.P