目前,我有:
<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>
还有其他建议吗?