在WP8中,ListPicker是否有可能不“推开”其他UI元素?

时间:2012-12-29 05:26:47

标签: xaml windows-phone-8 listpicker

目前,我有:

<StackPanel>
    <toolkit:ListPicker
         Header="Rating"
         ItemsSource="{Binding Ratings}"
         SelectedIndex="1"
         SelectionChanged="RatingSelectionChanged"/>
<TextBlock
          x:Name="RatingSelection"
          CacheMode="BitmapCache"/>
</StackPanel>

每当我按下ListPicker时,它都会扩展并推开Textblock。是否有一种方法可以使文本块保留在原位并且只是在ListPicker下?

更新1: 根据Will建议将两个网格布局相互叠加,问题仍然存在,listpicker的扩展会移动其他UI元素,更具体地说,按钮随着ListPicker的扩展而移动。另外,我已经包含了我正在使用的实际代码:

               <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>

                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>    

                        <Button 
                            Grid.Row="0"
                            Grid.Column="1"
                            Content="Save" 
                            Height="71" 
                            x:Name="SaveButton" 
                            Width="123" 
                            Click="SaveButton_Click"/>
                         <Button 
                            Grid.Row="0"
                            Grid.Column="2"
                            Content="Generate"
                            Height="71" 
                            x:Name="GenerateButton" 
                            Width="154" 
                            Click="GenerateButton_Click"/>

                          <Grid Grid.Row="0" Grid.Column="0">
                               <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                               </Grid.RowDefinitions>       

                               <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                               </Grid.ColumnDefinitions>

                         <toolkit:ListPicker
                             Grid.Row="0"
                             Grid.Column="0"
                             x:Name="Auth_ListPicker"
                             ItemsSource="{Binding}"
                             Width="156"
                             SelectedIndex="1"
                             SelectionChanged="Auth_ListPicker_SelectionChanged"/>
                          </Grid>            
           </Grid>

还有其他建议吗?

0 个答案:

没有答案