【问题标题】:Expression Blend 4 on Windows Phone 7: Difficulty with scrollingWindows Phone 7 上的 Expression Blend 4:滚动困难
【发布时间】:2010-10-14 03:48:01
【问题描述】:

我正在使用 Expression Blend 4 来制作 Windows Phone 7 应用程序的原型。我有一个应该显示新闻故事的页面。我很难让它在模拟器中一直向下滚动。我只能滚动查看一些文本框。有时,当我让ScrollViewer 更高时,我实际上可以在模拟器中滚动更少。

这是 XAML:

<!--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>

    <!--TitlePanel contains the name of the application and page title-->
    <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
        <TextBlock x:Name="ApplicationTitle" Text="NEWS" Style="{StaticResource PhoneTextNormalStyle}"/>
        <TextBlock x:Name="PageTitle" Text="New Physical Sciences Building: ‘Twenty-First Century Research’" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}" TextWrapping="Wrap" FontSize="40"/>
    </StackPanel>

    <!--ContentPanel - place additional content here-->
    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
        <ScrollViewer Margin="0,0,8,-2332">
            <StackPanel>
                <Image Height="313" Width="454" Source="new physics building large.jpg"/>
                <TextBlock TextWrapping="Wrap"><Run Text=" really long text "/></TextBlock>
            </StackPanel>
        </ScrollViewer>
    </Grid>
</Grid>

我做错了什么?

【问题讨论】:

    标签: silverlight windows-phone-7 expression-blend


    【解决方案1】:

    为什么 ScrollViewer 的底边距为 -2000?尝试设置 StackPanel 的宽度/高度...

    【讨论】:

    • 嗯...使用以下内容,我根本无法滚动:&lt;ScrollViewer Margin="0,0,8,0" Height="4000"&gt; 当我在 Expression 中手动将其拖出时,它会得到巨大的负边距。
    • 我认为您误解了 Scrollviewer 坐标的含义 - 它是 容器 的位置,而不是它的 内容。将 ScrollViewer 的大小设置为视图的大小(即 200x400),然后将 contents 的大小设置为非常大
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-07-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多