WP7 PivotControl 间距
如何在 PivotControl 中设置 PivotItems 标题之间的间距?我正在研究选项卡式设计,我能够自定义数据透视项标题 带有图标,但我不知道如何设置它们之间的间距。
这是我的 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>
How to set spacing between PivotItems headers in PivotControl? I'm working on tabbed design, I was able to customize pivotItems headers
with icons but I don't know how to set spacing between them.
here's my 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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以(应该)在一页上仅拥有一个枢轴控件。
如果您正在谈论 PivotItem 标头之间的间距,那么根据您的示例,您是否可以不只在要放入标头的 StackPanel 上设置
Margin
?这会向标题的左侧和右侧添加 20 个像素。
如果这不是您想要的,请更新您的问题。我建议添加您想要实现的目标的模型。
You can (should) only have one pivot control on a page.
If you are talking about the spacing between the PivotItem Headers then as per your example can you not just set a
Margin
on the StackPanel you are putting in the header?This adds 20 pixels to the left and right of the header.
If this isn't what you're after can you please update your question. I'd recommentd adding mock ups of what you're trying to achieve too.
您应该发布 xaml,但通常大多数 UI 元素都有一个
Margin
属性You should post you xaml, but usually most UI Elements have a
Margin
property