2011-07-26 95 views
1

我有一個列表框,新聞和列表框,評論,我試圖表明:列表框重疊問題

列表框中的新聞

列表框,評論

但沒有成功。 我有video of my problem,這裏是XAML:

<phone:PhoneApplicationPage 
    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:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:delay="clr-namespace:Delay;assembly=PhonePerformance" 
    xmlns:local="clr-namespace:iVk" 
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" 
    x:Class="iVk.newsDetail" 
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768" 
    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"> 
    <Grid Height="auto" Grid.Row="2" Grid.ColumnSpan="2" Margin="0,0,0,21" > 
     <ListBox Style="{StaticResource ax3}" x:Name="detailnewslistBox"> 
     <ListBox.ItemTemplate> 
      <DataTemplate> 
      <local:FoodTemplateSelector Content="{Binding}"> 
       ... 
      </local:FoodTemplateSelector> 
      </DataTemplate> 
     </ListBox.ItemTemplate> 
     <ListBox.ItemsPanel> 
      <ItemsPanelTemplate> 
      <StackPanel/> 
      </ItemsPanelTemplate> 
     </ListBox.ItemsPanel> 
     </ListBox>  
    </Grid> 
    <Grid Height="auto" Margin="0,0,0,21" > 
     <ListBox x:Name="comm_box" ItemsSource="{Binding}"> 
     <ListBox.ItemTemplate> 
      <DataTemplate> 
      <Grid Margin="{StaticResource PhoneTouchTargetOverhang}"> 
       <StackPanel VerticalAlignment="Top"> 
       <TextBlock Text="{Binding text}" Padding="11,0,0,0"/> 
       <TextBlock x:Name="datetimetext" Text="{Binding date_time}" Width="310"> 
       </TextBlock> 
       </StackPanel> 
      </Grid> 
      </DataTemplate> 
     </ListBox.ItemTemplate> 
     <ListBox.ItemsPanel> 
      <ItemsPanelTemplate> 
      <StackPanel/> 
      </ItemsPanelTemplate> 
     </ListBox.ItemsPanel> 
     </ListBox> 
    </Grid> 
    </Grid> 

</phone:PhoneApplicationPage> 

回答

2

你需要用2個listboxs在ScrollViewer中,你的列表框的滾動禁用:

<ScrollViewer VerticalScrollBarVisibility="Enabled"> 
    <StackPanel> 
     <ListBox ScrollViewer.VerticalScrollBarVisibility="Disabled" /> 
     <ListBox ScrollViewer.VerticalScrollBarVisibility="Disabled" /> 
    </StackPanel> 
</ScrollViewer> 
+0

Thanks.You幫了我很大的! – SevenDays