在windows手机中,如何实现像这样的类似android的tabview?

时间:2013-02-26 02:20:46

标签: windows-phone

this picture is android's tabview this is android-like tabview which in the pivot control

第一张图片是android的tabview
第二张图片是类似于机器人的tabview,它位于枢轴控制中 tabview位于枢轴页面网格
中 我想像第二张照片一样得到一个结果 任何建议都会很棒!!!!!
感谢

<phone:PhoneApplicationPage 
    x:Class="ewlan.PivotMainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" 
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="False">



    <Grid x:Name="LayoutRoot" Background="Transparent">

//what's in here?
//i know pivot
//what i need to know is what in the pivot.item
//hope u can know my meanings,any suggestions will be great

    </Grid>

1 个答案:

答案 0 :(得分:2)

好吧,如果你创建一个新的应用程序并添加一个Pivot页面,它将在Pivot控件中生成一些页面。我建议你看看它并添加必要的控件。有关详细信息,请查看MSDN reference。你会得到这样的东西:

<!--LayoutRoot is the root grid where all page content is placed.-->
<Grid x:Name="LayoutRoot" Background="Transparent">
    <!--Pivot Control-->
    <controls:Pivot Title="MY APPLICATION">
        <!--Pivot item one-->
        <controls:PivotItem Header="item1">
            <Grid/>
        </controls:PivotItem>

        <!--Pivot item two-->
        <controls:PivotItem Header="item2">
            <Grid/>
        </controls:PivotItem>
    </controls:Pivot>
</Grid>

Pivot包含PivotItems,而PivotItems又包含您的UI元素。