2010-12-16 32 views
1

如何設置PivotControl中PivotItems頭部之間的間距?我正在處理選項卡式設計,我可以使用圖標自定義pivotItems標題 ,但我不知道如何設置它們之間的間距。WP7 PivotControl Spacing

這裏是我的XAML:

<controls:Pivot Title="Tabs" FontSize="50" FontWeight="Bold" HorizontalAlignment="Center" Padding="0,0,0,0" Width="480" Margin="0,0,0,0"> 

     <!--Pivot item one--> 
     <controls:PivotItem Name="tab1" Margin="0,0,0,0" Padding="0,0,0,0"> 
      <controls:PivotItem.Header > 
       <ContentControl> 
        <StackPanel Orientation="Vertical" Background="#787878" Width="150"> 
         <Image Source="Images/tab_home.png" Height="80" Width="80"/> 
         <TextBlock Text="Listen" FontSize="32" VerticalAlignment="Center" HorizontalAlignment="Center"/> 
        </StackPanel> 
       </ContentControl> 
      </controls:PivotItem.Header> 

回答

3

你可以(應該)只有一個頁面上的一個支點控制。

如果你正在討論PivotItem Headers之間的間距,那麼按照你的例子,你可以不在StackPanel上設置一個Margin,你將它放在頭部?

<controls:PivotItem> 
    <controls:PivotItem.Header> 
     <ContentControl> 
      <StackPanel Orientation="Vertical" Background="#787878" Width="150" Margin="20,0,20,0"> 
       <Image Source="Images/tab_home.png" Height="80" Width="80"/> 
       <TextBlock Text="Listen" FontSize="32" VerticalAlignment="Center" HorizontalAlignment="Center"/> 
      </StackPanel> 
     </ContentControl> 
    </controls:PivotItem.Header> 

這會在標題的左側和右側添加20個像素。

如果這不是你想要的,你可以更新你的問題。我會推薦添加你想要實現的模型。

+1

yes就是這樣,Margin =「0,0,-10,0」在PivotItem.Header StackPanel中工作得很好,謝謝 – Janci 2010-12-16 12:40:26

0

你應該張貼您的XAML,但通常大部分UI元素有Margin財產