首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在windows 8应用程序中将支点置于网格下

在windows 8应用程序中将支点置于网格下
EN

Stack Overflow用户
提问于 2014-06-06 01:39:46
回答 1查看 309关注 0票数 0

我正在创建一个windows 8应用程序。应用程序具有支点。所需的是在枢轴顶部有一个静态块来显示数据,这些数据无论当前可见于哪个枢轴,都需要始终显示。它的一个例子是AccuWeather应用程序。

我尝试过放置堆栈面板、列表视图、文本框等,但这两个控件都在同一个网格下覆盖,但它不起作用。

另外,我还尝试将另一个网格放置在支撑支点的网格上,在这种情况下,页面将停止显示。

关于如何解决这个问题,有什么建议/帮助吗?

我在网上搜索过,但找不到合适的信息。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-06-06 04:43:52

试试这个:

代码语言:javascript
复制
[<phone:PhoneApplicationPage
    x:Class="SampleStackPivotApp.MainPage"
    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:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DataContext="{d:DesignData SampleData/MainViewModelSampleData.xaml}"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--Static Control Block-->
        <Grid x:Name="StaticContentGrid" Margin="12,0,12,0">
            <StackPanel>
                <TextBlock Text="Some Content goes Here" FontSize="30"></TextBlock>
                <TextBlock Text="Another Content goes Here" ></TextBlock>
            </StackPanel>
        </Grid>


        <!--Pivot Control-->
        <phone:Pivot Grid.Row="1">
            <phone:Pivot.Title>
                    <StackPanel>
                        <TextBlock Text="Pivot Name Goes here"></TextBlock>
                    </StackPanel>
            </phone:Pivot.Title>
            <!--Pivot item one-->
            <phone:PivotItem Header="first">
                <!--Double line list with text wrapping-->
                <phone:LongListSelector Margin="0,0,-12,0" ItemsSource="{Binding Items}">
                    <phone:LongListSelector.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Margin="0,0,0,17">
                                <TextBlock Text="{Binding LineOne}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}"/>
                                <TextBlock Text="{Binding LineTwo}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}"/>
                            </StackPanel>
                        </DataTemplate>
                    </phone:LongListSelector.ItemTemplate>
                </phone:LongListSelector>
            </phone:PivotItem>

            <!--Pivot item two-->
            <phone:PivotItem Header="second">
                <!--Double line list no text wrapping-->
                <phone:LongListSelector Margin="0,0,-12,0" ItemsSource="{Binding Items}">
                    <phone:LongListSelector.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Margin="0,0,0,17">
                                    <TextBlock Text="{Binding LineOne}" TextWrapping="NoWrap" Margin="12,0,0,0" Style="{StaticResource PhoneTextExtraLargeStyle}"/>
                                    <TextBlock Text="{Binding LineThree}" TextWrapping="NoWrap" Margin="12,-6,0,0" Style="{StaticResource PhoneTextSubtleStyle}"/>
                                </StackPanel>
                            </DataTemplate>
                    </phone:LongListSelector.ItemTemplate>
                </phone:LongListSelector>
            </phone:PivotItem>
        </phone:Pivot>
    </Grid>
</phone:PhoneApplicationPage>][1]
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24072880

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档