在同一行上对齐文本

Las*_*vik 2 xaml xamarin.forms

我在同一行中显示绑定数据时遇到问题。

我想这样显示:

2018-01-01-2018-01-07

<Label Text="{Binding ChartDate, StringFormat='{0:d}'}"></Label>   
<Label Text="-"></Label>
<Label Text="{Binding ChartDateTo, StringFormat='{0:d}'}" ></Label>
Run Code Online (Sandbox Code Playgroud)

怎么样了 我试图将第二个装订移动到第一个标签上,但是什么也没显示

dev*_*998 5

尝试这个:

<StackLayout Orientation="Horizontal">
    <StackLayout.Children>
        <Label Text="{Binding ChartDate, StringFormat='{0:d}'}"></Label> 
        <Label Text="-"></Label>
        <Label Text="{Binding ChartDateTo, StringFormat='{0:d}'}" ></Label> 
    </StackLayout.Children>
</StackLayout>
Run Code Online (Sandbox Code Playgroud)