在选择Entry Control之前,Xamarin.Forms Switch Control在Android上不可见

在选择Entry Control之前,Xamarin.Forms Switch Control在Android上不可见,第1张

概述我有一个看起来大致相同的注册表 <StackLayout> <StackLayout HorizontalOptions="FillAndExpand" Padding="{x:Static local:Styles.LabelBeforeEntryPadding}"> <Label Text="{Binding 我有一个看起来大致相同的注册表

<StackLayout>    <StackLayout         HorizontalOptions="FillAndExpand"         padding="{x:Static local:Styles.LabelBeforeEntrypadding}">        <Label             Text="{Binding LabelPasswort2}"             HorizontalOptions="{x:Static local:Styles.LabelHorizontalOptions}"             Textcolor="{x:Static local:Styles.RegistrationPageTextcolor}" />    </StackLayout>    <custom:StrypeEntry         Text="{Binding Passwort2}"         IsPassword="true"         IsEnabled="{Binding ControlsEnabled}"         HorizontalOptions="FillAndExpand" /></StackLayout><!--Newsletter--><StackLayout     OrIEntation="Horizontal"     HorizontalOptions="StartAndExpand">    <Switch         IsToggled="{Binding Newsletter}"         IsEnabled="{Binding ControlsEnabled}"         VerticalOptions="StartAndExpand"         HorizontalOptions="StartAndExpand"  />    <Label         Text="{Binding LabelNewsletter}"         VerticalOptions="CenterandExpand"         HorizontalOptions="Start"         Textcolor="{x:Static local:Styles.RegistrationPageTextcolor}" /></StackLayout><!--Datenschutz--><StackLayout     OrIEntation="Horizontal"     HorizontalOptions="StartAndExpand">    <custom:StrypeSwitch         IsToggled="{Binding Privacy}"         IsEnabled="{Binding ControlsEnabled}"         VerticalOptions="StartAndExpand"         HorizontalOptions="StartAndExpand" />    <Label         Text="{Binding LabelPrivacy}"         VerticalOptions="CenterandExpand"         HorizontalOptions="Start"         WIDthRequest="300" Textcolor="{x:Static local:Styles.RegistrationPageTextcolor}" /></StackLayout>

问题是,在显示表单时,开关不可见,它们仅在条目聚焦时才可见.

StrypeEntry只是一个带有border Corder的自定义条目和一个大写的道具,没有任何花哨的东西,而且为了切换我做了一个自定义渲染器来修复不显示的问题.

我已经尝试了buttonText Alignment的修复,但没有帮助(Xamarin.Forms: wrong button text alignment after click (Android))

我也尝试过这个

public overrIDe voID ChildDrawableStateChanged(VIEw child){    base.ChildDrawableStateChanged(child);    Control.Text = Control.Text;    Control.Checked = Control.Checked;}

但仍无法解决

(我正在使用AndroID 4.4.2测试GT-I9505.Xamarin.Forms程序集的版本是1.2.2.0)

请帮我,
谢谢

解决方法 好像我必须回答我自己的问题.

我通过在xaml中向Switch添加Height-和WIDthRequest来修复此问题

希望这有助于其他人.
也许如果您找到更好的解决方案,请告诉我.

问候〜

总结

以上是内存溢出为你收集整理的在选择Entry Control之前,Xamarin.Forms Switch Control在Android上不可见全部内容,希望文章能够帮你解决在选择Entry Control之前,Xamarin.Forms Switch Control在Android上不可见所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1130080.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-30
下一篇2022-05-30

发表评论

登录后才能评论

评论列表(0条)

    保存