2014-01-19 45 views
2

我有以下XAML代碼:的Windows Phone 8的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 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設置爲自動佈局高度/寬度。

我甚至可以看到下一行文本的頂部,當我滾動其餘的時候沒有出現。很難截圖,因爲你只能在滾動時看到問題,而滾動時我無法截圖:/

任何想法,哪裏出錯了?

我已經在這個網站上看過無數帖子,但是沒有什麼能打到我之後的東西。

謝謝。

回答

2

這結束了對我的工作:

<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高度AUTO

+2

哦地獄當真?就是這樣......哈哈,我正在從我的恥辱中走出來。乾杯:) –

相關問題