Entry Cursor Color on iOS
This 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:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core">
<StackLayout>
<Entry ... ios:Entry.CursorColor="LimeGreen" />
</StackLayout>
</ContentPage>
Alternatively, it can be consumed from C# using the fluent API:
using Xamarin.Forms.PlatformConfiguration;
using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
...
var entry = new Xamarin.Forms.Entry();
entry.On<iOS>().SetCursorColor(Color.LimeGreen);
The Entry.On<iOS>
method specifies that this platform-specific will only run on iOS. The Entry.SetCursorColor
method, in the Xamarin.Forms.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
: