Windows Phone 8文本块从XAML中剪切文本

Windows Phone 8文本块从XAML中剪切文本,xaml,windows-phone-8,grid,scrollviewer,textblock,Xaml,Windows Phone 8,Grid,Scrollviewer,Textblock,我有以下XAML代码: <!--LayoutRoot is the root grid where all page content is placed--> <Grid x:Name="LayoutRoot" Background="#FFE8E8E8"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Heigh

我有以下XAML代码:

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

    <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,0" >
        <TextBlock  x:Name="AppName" Text="Agent" Style="{StaticResource PhoneTextNormalStyle}" Margin="12,0" Foreground="Black" />
        <TextBlock  x:Name="PageName" Text="agent audit" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}" Height="100" Foreground="Black"/>
    </StackPanel>

    <Grid x:Name="ContentPanel" Grid.Row="1" Background="White"/>

    <ScrollViewer HorizontalAlignment="Left" Margin="0,0,0,0" Grid.Row="1" VerticalAlignment="Top">
        <TextBlock x:Name="auditText"  HorizontalAlignment="Left" Margin="0,0,0,0" Grid.Row="1" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Top" Foreground="Black" Padding="10"/>
    </ScrollViewer>
</Grid>

当页面进入视图时,我用API调用的内容(审计日志文本)分配TextBlock,这会变得相当长

但是,目前它会切断屏幕高度以下的所有文本。我将TextBlock和ScrollView设置为自动布局高度/宽度

我甚至可以看到下一行文本的顶部,当我滚动时,其余的都不会出现。也很难截屏,因为您只在滚动时看到问题,而在滚动时,我无法截屏:/

知道我哪里出错了吗

我在这个网站上读了很多帖子,但没有什么能完全符合我的要求


谢谢。

这最终对我有用:

<ScrollViewer Height="Auto"  Grid.Row="1">
            <TextBlock x:Name="auditText" Text="TextBlock" 
         VerticalAlignment="Top" Foreground="Black" Margin="0,10,0,0" Grid.Row="1" Padding="20" TextWrapping="Wrap">
            </TextBlock>
        </ScrollViewer>


将ScrollViewer高度设置为“自动”

哦,真的吗?就这样。。。哈哈,我是出于羞耻而去拿我的。干杯:)