【发布时间】:2015-04-27 20:29:50
【问题描述】:
我在 StackPanel 中为 Windows Phone 8.1 添加了 XAML 中的组合框。在模拟器中运行应用程序时,不会显示下拉功能。如果我将 StackPanel 限制为一个高度,例如“70”,仅显示前 2 个项目。如果我说 Height = "Auto" 那么所有项目都会立即显示。
如何启用下拉功能?
标题:
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:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
组合框 ..
<StackPanel Grid.Row="4" Width="350" HorizontalAlignment="Left">
<TextBlock x:Name="PlayerListPanel" TextWrapping="Wrap" Text="Select a Player" VerticalAlignment="Center" Margin="2,0,0,0" HorizontalAlignment="Left"/>
<ComboBox Name="StartPlayerComboBox" BorderThickness="1" >
<ComboBoxItem Tag="PLAYER1">Player 1</ComboBoxItem>
<ComboBoxItem Tag="PLAYER2">Player 2</ComboBoxItem>
<ComboBoxItem Tag="PLAYER3">Player 3</ComboBoxItem>
<ComboBoxItem Tag="Dummy1">1</ComboBoxItem>
<ComboBoxItem Tag="Dummy2">2</ComboBoxItem>
<ComboBoxItem Tag="Dummy3">3</ComboBoxItem>
</ComboBox>
</StackPanel>
【问题讨论】:
标签: xaml combobox windows-phone-8.1