0
我創建UWP應用程序並使用RelativePanel。 我使用相對panel.alignwithright,頂部,左側,底部面板拉伸寬度到列表視圖。 但在將其他元素(例如Stackpanel)添加到列表視圖的右側後,其他面板不會在頁面中查看。 所以我刪除relativePanel.AlignWithRight,在這種情況下不能在列表視圖中拉伸寬度。UWP Xaml相對面板,拉伸和其他元素
我該怎麼辦?
代碼:
<RelativePanel x:Name="Information" Grid.Row="1">
<ListView x:Name="MyList"
RelativePanel.AlignBottomWithPanel="True"
RelativePanel.AlignTopWithPanel="True"
RelativePanel.AlignRightWithPanel="True"
RelativePanel.AlignLeftWithPanel="True">
<ListView.ItemTemplate>
<DataTemplate>
<userControl:SpendListItem_Template Tapped="SpendListItem_Template_Tapped" ></userControl:SpendListItem_Template>
</DataTemplate>
</ListView.ItemTemplate>
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
<Setter Property="Margin" Value="10,0,10,10"></Setter>
</Style>
</ListView.ItemContainerStyle>
</ListView>
<StackPanel x:Name="TotalInformation" RelativePanel.RightOf="MyList" Width="100">
<TextBlock>Test Data</TextBlock>
</StackPanel>
</RelativePanel>
感謝。它工作得很好。 –