【发布时间】:2018-03-08 08:19:22
【问题描述】:
这是我的 XAML
<RelativePanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Margin="10,0,0,0">
<TextBlock x:Name="PageTitle"
RelativePanel.AlignTopWithPanel="True"
Style="{StaticResource WindowTitle}">This is my page title</TextBlock>
<TextBlock x:Name="ActivityLabel"
RelativePanel.Below="PageTitle"
Style="{StaticResource CaptionTitle}">Activity</TextBlock>
<ComboBox x:Name="ActivityOptions"
RelativePanel.RightOf="ActivityLabel"
RelativePanel.AlignRightWithPanel="True"
RelativePanel.AlignHorizontalCenterWith="ActivityLabel"
ItemsSource="{Binding Path=SupportedActivityTypes}">
</ComboBox>
</RelativePanel>
我想要实现的是标题在页面顶部,标题下方有多行。每行都有一个标题,标题右侧是组合框、文本框等,但右侧应延伸到面板的右边框。
显然我的代码不起作用,该组合甚至没有与我在标记中指定的标题文本居中对齐。以及如何让combo的左边接触到标题文字,右边接触到面板的边框?
【问题讨论】:
标签: xaml uwp uwp-xaml relativepanel