Xaml 控件通过Windows Phone 8.1上的组合框下拉菜单显示
我刚刚开始使用VS2013和Windows Phone SDK 8使用XAML。我有一个HubSection,在网格中有几个组合框控件。当您打开一个组合框下拉列表时,它会在下拉列表中显示应该在其后面的控件 有没有关于如何解决这个问题的建议?即使我可以单独打开下拉列表(我有另一个包含13项的组合框,如果打开它,它将自动显示全屏) 谢谢你的帮助Xaml 控件通过Windows Phone 8.1上的组合框下拉菜单显示,xaml,visual-studio-2013,windows-phone-8.1,Xaml,Visual Studio 2013,Windows Phone 8.1,我刚刚开始使用VS2013和Windows Phone SDK 8使用XAML。我有一个HubSection,在网格中有几个组合框控件。当您打开一个组合框下拉列表时,它会在下拉列表中显示应该在其后面的控件 有没有关于如何解决这个问题的建议?即使我可以单独打开下拉列表(我有另一个包含13项的组合框,如果打开它,它将自动显示全屏) 谢谢你的帮助 霍米德 梅蒂斯 狼疮 Ragabash(新月) 月牙 Philodox(半月形) 加利亚德(凸月) 阿伦(满月) 黑色愤怒 啃骨器 盖亚的孩子们 芬娜
霍米德
梅蒂斯
狼疮
Ragabash(新月)
月牙
Philodox(半月形)
加利亚德(凸月)
阿伦(满月)
黑色愤怒
啃骨器
盖亚的孩子们
芬娜
得到芬里斯
玻璃步行器
红色爪子
暗影领主
无声漫游者
银牙
天文学家
乌克特纳
温迪哥
问题在于控件位于网格内,这会导致控件相互重叠,除非使用不同的行/列。但改变这种情况的最简单方法是使用StackPanel,这会使元素自动水平或垂直堆叠。这意味着您不需要使用手动边距和对齐来获得良好的布局
这是修改后的XAML,我还添加了一个滚动查看器,以防组合框在视图外展开:
霍米德
梅蒂斯
狼疮
Ragabash(新月)
月牙
Philodox(半月形)
加利亚德(凸月)
阿伦(满月)
黑色愤怒
啃骨器
盖亚的孩子们
芬娜
得到芬里斯
玻璃步行器
红色爪子
暗影领主
无声漫游者
银牙
天文学家
乌克特纳
温迪哥
你能发布xaml代码吗?用该代码编辑谢谢,约翰。通过同样的方法,我最终能够使这项工作正常进行。我将把这个标记为答案。
<HubSection x:Uid="CharacterInfo" Header="Character Information" DataContext="{Binding Groups}" HeaderTemplate="{ThemeResource HubSectionHeaderTemplate}">
<DataTemplate>
<Grid>
<TextBlock HorizontalAlignment="Left" Margin="10,0,0,0" TextWrapping="Wrap" Text="Character Name:" VerticalAlignment="Top" FontSize="18"/>
<TextBox HorizontalAlignment="Left" Margin="10,20,0,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Width="321" Height="10"/>
<TextBlock HorizontalAlignment="Left" Margin="10,60,0,0" TextWrapping="Wrap" Text="Breed:" VerticalAlignment="Top" FontSize="18"/>
<ComboBox HorizontalAlignment="Left" Margin="10,80,0,0" VerticalAlignment="Top" Width="321">
<ComboBoxItem Tag="HOMID" IsSelected="True">Homid</ComboBoxItem>
<ComboBoxItem Tag="METIS">Metis</ComboBoxItem>
<ComboBoxItem Tag="LUPUS">Lupus</ComboBoxItem>
</ComboBox>
<TextBlock HorizontalAlignment="Left" Margin="10,150,0,0" TextWrapping="Wrap" Text="Auspice:" VerticalAlignment="Top" FontSize="18"/>
<ComboBox HorizontalAlignment="Left" Margin="10,170,0,0" VerticalAlignment="Top" Width="321">
<ComboBoxItem Tag="RAGABASH" IsSelected="True">Ragabash (New Moon)</ComboBoxItem>
<ComboBoxItem Tag="THEURGE">Theurge (Crescent Moon)</ComboBoxItem>
<ComboBoxItem Tag="PHILODOX">Philodox (Half Moon)</ComboBoxItem>
<ComboBoxItem Tag="GALLIARD">Galliard (Gibbous Moon)</ComboBoxItem>
<ComboBoxItem Tag="AHROUN">Ahroun (Full Moon)</ComboBoxItem>
</ComboBox>
<TextBlock HorizontalAlignment="Left" Margin="10,240,0,0" TextWrapping="Wrap" Text="Tribe:" VerticalAlignment="Top" FontSize="18"/>
<ComboBox HorizontalAlignment="Left" Margin="10,260,0,0" VerticalAlignment="Top" Width="321">
<ComboBoxItem Tag="BLACKFURIES" IsSelected="True">Black Furies</ComboBoxItem>
<ComboBoxItem Tag="BONEGNAWERS">Bone Gnawers</ComboBoxItem>
<ComboBoxItem Tag="CHILDRENOFGAIA">Children of Gaia</ComboBoxItem>
<ComboBoxItem Tag="FIANNA">Fianna</ComboBoxItem>
<ComboBoxItem Tag="GETOFFENRIS">Get of Fenris</ComboBoxItem>
<ComboBoxItem Tag="GLASSWALKERS">Glass Walkers</ComboBoxItem>
<ComboBoxItem Tag="REDTALONS">Red Talons</ComboBoxItem>
<ComboBoxItem Tag="SHADOWLORDS">Shadow Lords</ComboBoxItem>
<ComboBoxItem Tag="SILENTSTRIDERS">Silent Striders</ComboBoxItem>
<ComboBoxItem Tag="SILVERFANGS">Silver Fangs</ComboBoxItem>
<ComboBoxItem Tag="STARGAZERS">Stargazers</ComboBoxItem>
<ComboBoxItem Tag="UKTENA">Uktena</ComboBoxItem>
<ComboBoxItem Tag="WENDIGO">Wendigo</ComboBoxItem>
</ComboBox>
</Grid>
</DataTemplate>
</HubSection>