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:
Visszajelzés
https://aka.ms/ContentUserFeedback.
Hamarosan elérhető: 2024-ben fokozatosan kivezetjük a GitHub-problémákat a tartalom visszajelzési mechanizmusaként, és lecseréljük egy új visszajelzési rendszerre. További információ:Visszajelzés küldése és megtekintése a következőhöz: