Windows   发布时间:2022-05-07  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了windows-phone-7 – 如何为枢轴项目标题添加图像大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在开发一个简单的应用程序来学习wp7中的枢轴控制.

我们可以添加枢轴项目的图像而不是标题中的文本(波纹管图像中的红色标记区域).

是否可以添加图片,请建议我

我的xaml代码是:

<Grid x:Name="LayoutRoot" Background="Transparent">
    <!--Pivot Control-->
    <controls:Pivot Title="MY APPLICATION" Name="mainPivot">
        <!--Pivot item one-->
        <controls:PivotItem Header="item1">
            <Grid>
                <Image Source="/SchoolList;component/Gallery/child.jpg"/>
            </Grid>
        </controls:PivotItem>

        <!--Pivot item two-->
        <controls:PivotItem Header="item2">
            <Grid>
                <Image Source="/SchoolList;component/Gallery/class.jpg"/>
            </Grid>
        </controls:PivotItem>
    </controls:Pivot>
</Grid>

提前致谢

使用这个提示:
<phone:Pivot>
        <phone:Pivot.HeaderTemplate>
            <DataTemplate>
                <Image Source="{Binding}" /> // important
            </DataTemplate>
        </phone:Pivot.HeaderTemplate> 
</phone:Pivot>

然后将您的Pivot项标题设置为

<phone:PivotItem Header="path-to-image" >

大佬总结

以上是大佬教程为你收集整理的windows-phone-7 – 如何为枢轴项目标题添加图像全部内容,希望文章能够帮你解决windows-phone-7 – 如何为枢轴项目标题添加图像所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: