如何更改按钮上的标签颜色单击 Xamarin

问题描述 投票:0回答:1
<Label Text="pass or username is incorrect" TextColor="Red" x:Name="FailureResult" IsVisible="false"/>

else里应该写什么

if ((await UserManaging.ReadAllAsync()).FirstOrDefault(x => x.Name == name && x.Password == pass) != null)
{
  await Navigation.PushAsync(new HomePage());
}
else
{
  
}

我希望它看起来像这样,但只有在通行证或用户名错误之后

xamarin xamarin.forms xamarin.android
1个回答
0
投票

您不需要更改颜色,只需更改可见性

FailureResult.IsVisible = true;
© www.soinside.com 2019 - 2024. All rights reserved.