标签: xamarin.forms.entry

Xamarin.Forms:在 iOS 上启用暗模式时,禁用条目具有白色 TextColor

当启用暗模式时,我在 iOS 上的条目的 TextColor 似乎有一些问题。每当我将 Entry 的 Enabled 状态设置为 false 时,TextColor 就会变成白色并且无法更改。我使用以下简单的代码来重现这一点。

Page.xaml

    <Entry x:Name="TestEntry" />
Run Code Online (Sandbox Code Playgroud)
Page.xaml.cs

    public OnboardingPage()
    {
        InitializeComponent();

        TestEntry.Text = "Testo";
        TestEntry.TextColor = Color.Blue;
        TestEntry.IsEnabled = false;
    }
Run Code Online (Sandbox Code Playgroud)

我目前使用的是最新版本的 Xamarin.Forms。(4.4.0.991640)

有人知道这里出了什么问题吗?我不认为这是预期的行为..

提前致谢!

ios xamarin xamarin.forms xamarin.forms.entry ios-darkmode

7
推荐指数
1
解决办法
821
查看次数

2
推荐指数
1
解决办法
745
查看次数

删除 Xamarin.Forms 键盘上的完成按钮

我需要从用户那里获取文本作为输入。我使用编辑器,因为输入可以是多行的。但是,当用户聚焦时,会显示键盘上的编辑器完成按钮。我需要将其删除。当我使用条目而不是编辑器时,完成按钮不会显示,但我需要以多行形式获取输入。我可以删除“完成”按钮还是可以将条目用作多行?

keyboard editor xamarin.forms xamarin.forms.entry

1
推荐指数
1
解决办法
2381
查看次数

如何在 xamarin 表单中自动大写键盘/条目

我有两个条目用户名和密码。用户名和密码总是大写。如何强制键盘或输入项,当我键入内容时,文本将变为大写?

<Frame StyleClass="lpframe" x:Name="usernameFrame" CornerRadius="5" BorderColor="Transparent" HasShadow="False">
                <StackLayout>
                    <Label Text="USERNAME" StyleClass="lbl-login">
                        <Label.FontFamily>
                            <OnPlatform x:TypeArguments="x:String">
                                <On Platform="Android" Value="OpenSans-Semibold.ttf#OpenSans-Semibold"/>
                            </OnPlatform>
                        </Label.FontFamily>
                    </Label>
                    <local:CustomEntry Placeholder="Username" PlaceholderColor="#879baa" Unfocused="entUser_Unfocused" StyleClass="form-control" ReturnType="Next" x:Name="entUser">
                        <local:CustomEntry.FontFamily>
                            <OnPlatform x:TypeArguments="x:String">
                                <On Platform="Android" Value="OpenSans-Regular.ttf#OpenSans-Regular"/>
                            </OnPlatform>
                        </local:CustomEntry.FontFamily>
                    </local:CustomEntry>
                </StackLayout>
            </Frame>
            <Frame StyleClass="lpframe" x:Name="passwordFrame" CornerRadius="5" BorderColor="Transparent" HasShadow="False">
                <StackLayout>
                    <Label Text="PASSWORD" StyleClass="lbl-login">
                        <Label.FontFamily>
                            <OnPlatform x:TypeArguments="x:String">
                                <On Platform="Android" Value="OpenSans-Semibold.ttf#OpenSans-Semibold"/>
                            </OnPlatform>
                        </Label.FontFamily>
                    </Label>
                    <local:CustomEntry Placeholder="Password" PlaceholderColor="#879baa" Unfocused="entPassword_Unfocused" IsPassword="True" StyleClass="form-control" ReturnType="Go" x:Name="entPassword">
                        <local:CustomEntry.FontFamily>
                            <OnPlatform x:TypeArguments="x:String">
                                <On Platform="Android" Value="OpenSans-Regular.ttf#OpenSans-Regular"/>
                            </OnPlatform>
                        </local:CustomEntry.FontFamily>
                    </local:CustomEntry>
                </StackLayout>
            </Frame>
Run Code Online (Sandbox Code Playgroud)

xaml xamarin xamarin.forms xamarin.forms.entry

0
推荐指数
1
解决办法
2055
查看次数