XAML:
<ListView x:Name="CoinsBox" Margin="10,28,0,76" Width="336" >
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Height="40" >
<TextBlock Text="{Binding Title}" VerticalAlignment="Top" HorizontalAlignment="Left" />
<TextBlock Text="{Binding TitleShort}" VerticalAlignment="Bottom" HorizontalAlignment="Left" />
<TextBlock Text="{Binding Price}" VerticalAlignment="Top" HorizontalAlignment="Right" />
<TextBlock Text="{Binding Volume}" VerticalAlignment="Bottom" HorizontalAlignment="Right" />
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
如何将两个文本框相互放置?
如果Orientation="Vertical"
最后两列应该在下
现在
它必须是
答案 0 :(得分:1)
像这样使用嵌套堆栈面板。然后,要控制列之间的间距,请在内部堆栈面板之一中放置边距。
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical">
<TextBlock Text="Haxen"/>
<TextBlock Text="hxn"/>
</StackPanel>
<StackPanel Orientation="Vertical">
<TextBlock Text="10000$"/>
<TextBlock Text="40404040"/>
</StackPanel>
</StackPanel>