0
votes

I am working on a phone project which requires a pivot page. I need to change the foreground and fontsize of PivotItem Headers. nothing changes when I tried to code them in xaml

<phone:PivotItem Header="item1" Foreground="black" fontsize="25" >

do I have to use style for them?

2

2 Answers

0
votes

You need to change the HeaderTemplate For example like this:

<controls:Pivot.HeaderTemplate>
    <DataTemplate>
        <StackPanel Margin="0">
            <TextBlock FontSize="25" Margin="0" Text="{Binding}"/>
        </StackPanel>
    </DataTemplate>
</controls:Pivot.HeaderTemplate>

<controls:PivotItem Header="item1">
</controls:PivotItem>
0
votes

you can try like this ..

in this i have shown how to make a header of one item you can do this for rest of the others

 <phone:Pivot Title="MY APPLICATION">
                <!--Pivot item one-->
                <phone:PivotItem >
                    <phone:PivotItem.Header>
                        <StackPanel Background="#132d63" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                            <TextBlock Text="hhaha" FontSize="35" Foreground="White" Padding="10,10,10,10" />
                        </StackPanel>
                    </phone:PivotItem.Header>                  
                </phone:PivotItem>
 </phone:Pivot>