Entry Cursor Color on iOS
This .NET Multi-platform App UI (.NET MAUI) iOS platform-specific sets the cursor color of an Entry to a specified color. It's consumed in XAML by setting the Entry.CursorColor
bindable property to a Color:
<ContentPage ...
xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls">
<StackLayout>
<Entry ... ios:Entry.CursorColor="LimeGreen" />
</StackLayout>
</ContentPage>
Alternatively, it can be consumed from C# using the fluent API:
using Microsoft.Maui.Controls.PlatformConfiguration;
using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;
...
Entry entry = new Microsoft.Maui.Controls.Entry();
entry.On<iOS>().SetCursorColor(Colors.LimeGreen);
The Entry.On<iOS>
method specifies that this platform-specific will only run on iOS. The Entry.SetCursorColor
method, in the Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific
namespace, sets the cursor color to a specified Color. In addition, the Entry.GetCursorColor
method can be used to retrieve the current cursor color.
The result is that the cursor color in a Entry can be set to a specific Color:
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for