9/3/2023 0 Comments Change edittext cursor color![]() ![]() If the response is helpful, please click " Accept Answer" and upvote it. Here is xml_file_name.xml in Drawable folder. NativeEditText.SetTextCursorDrawable(_file_name) Protected override void OnElementChanged(ElementChangedEventArgs e)ĮditText nativeEditText = (global::)Control Public MyEntry(Context context) : base(context) You can create entry's custom-renderer for this issue. How can we dynamically set the cursor color for Entry and Editor on Android when using XF 5.0 ? IntPtr mCursorDrawableResProperty = JNIEnv.GetFieldID(IntPtrTextViewClass, "mCursorDrawableRes", "I") įor iOS, Xamarin now provide a SetCursorColor method (see ). : no "I" field "mCursorDrawableRes" in class "Landroid/widget/TextView " or its superclasses IntPtr IntPtrTextViewClass = JNIEnv.FindClass(typeof(TextView)) Instead, that code (see below) now throws ![]() As a result, the piece of code that is found in multiple locations when Googling that allows the cursor color for Xamarin.Forms Entry and Editor Views to be set dynamically no longer works. Having just upgraded from XF 4.8 to 5.0, I've had to migrate to using AndroidX. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |