2014-01-06 22 views
1

我有下面的代码文本块不填写手机窗口

<!--LayoutRoot is the root grid where all page content is placed--> 
    <Grid x:Name="LayoutRoot" Background="Transparent" Loaded="LayoutRoot_Loaded"> 
     <Grid.RowDefinitions> 
      <RowDefinition Height="Auto"/> 
      <RowDefinition Height="*"/> 
      <RowDefinition Height="70"/> 
     </Grid.RowDefinitions> 
     <!--TitlePanel contains the name of the application and page title--> 
     <TextBlock x:Name="ApplicationTitle" FontWeight="Bold" Padding="20,0,0,0" Grid.Row="0" Text="فرآن کریم"/> 


     <ListBox x:Name="myListBox" Grid.Row="1" Padding="0,0,0,0" ScrollViewer.VerticalScrollBarVisibility="Visible"> 
      <ListBox.ItemTemplate> 
       <DataTemplate> 
        <StackPanel Orientation="Vertical" Background="{Binding Converter={StaticResource AlternateRowConverter}}" Tap="pQuranAya_Tap"> 
         <TextBlock Width="Auto" Text="{Binding Aya}" Foreground="Black" FontSize="50" Padding="20,0,0,20" TextWrapping="Wrap" Tap="TextBlock_Tap" /> 
         <StackPanel Background="Black" /> 
         <TextBlock Width="Auto" Text="{Binding AyaTranslation}" Foreground="Black" FontSize="35" Padding="20,0,0,20" TextWrapping="Wrap" /> 
        </StackPanel> 
       </DataTemplate> 
      </ListBox.ItemTemplate> 
     </ListBox> 

我想文本块应该在窗口的大小始终,但它的文字大小。我怎样才能填补窗口大小?

感谢,

回答

0

删除<TextBlock Width="Auto"并添加<TextBlock HorizontalAlignment="Stretch"。之后,你的文本块将适合父容器(窗口,网格,堆栈面板)。

+0

感谢您的回复,实在没办法,我设置的属性列表框,StackPanel中和文本块,但没有工作:( – ARH

+0

将相同的属性设置为' crea7or

+0

谢谢,它也没有帮助,我不知道可能是什么问题? – ARH

0

删除填充=“20,0,0,20”和保证金(如果你有在该代码)

+0

谢谢,虽然我需要填充,但我删除了它,但它没有帮助。 – ARH

+0

尝试添加保证金像保证金(0,0,0,0).. –

+0

保证金并没有帮助(我为网格,列表框,堆栈面板和文本块设置保证金) – ARH