【发布时间】:2020-02-28 11:15:22
【问题描述】:
如何将徽标添加到 Xaml 表单的中心,我开始使用 Xamarin。
我的 xaml 代码如下所示:
<StackLayout Spacing="20" Padding="50" VerticalOptions="Center">
<Entry Placeholder="Mail id"></Entry>
<Entry Placeholder="Password" IsPassword="True"></Entry>
<Button Text="Log In" TextColor="White" BackgroundColor="##ff77D065"></Button> </StackLayout>
</ContentPage>
这很好用,现在我想看看在哪里可以将徽标添加到 Xaml 表单,它的跨平台。
我是新手。
编辑
尝试这样的事情
<StackLayout Spacing="20" Padding="50" VerticalOptions="Center">
VerticalOptions="Center" Padding="10">
<Image Source="screenimg2.png" x:Name="imgLogo" HeightRequest="150" WidthRequest="150"/>
<Entry Placeholder="Mail id"></Entry>
<Entry Placeholder="Password" IsPassword="True"></Entry>
<Button Text="Log In" TextColor="White" BackgroundColor="##ff77D065"></Button>
</StackLayout>
【问题讨论】:
-
看看这个thread
-
使用
Image控件 -
@Jason ,你的意思是在 Edits 上是这样的吗?请看编辑?
-
@Sam 您是否试图将
Image居中,而不是将所有其他控件覆盖在页面居中图像的顶部? -
@SushiHangover,是的