protected override void OnElementChanged(ElementChangedEventArgs <Entry> e) { base.OnElementChanged(e); if (e.OldElement != null || e.NewElement == null) { return; } element = (ImageEntry)Element; var editText = Control; if (!string.IsNullOrEmpty(element.Image)) { switch (element.ImageAlignment) { case ImageAlignment.Left: editText.SetCompoundDrawablesWithIntrinsicBounds(GetDrawable(element.Image), null, null, null); break; case ImageAlignment.Right: editText.SetCompoundDrawablesWithIntrinsicBounds(null, null, GetDrawable(element.Image), null); break; } } editText.CompoundDrawablePadding = 25; #if MONOANDROID90 Control.Background.SetColorFilter(element.LineColor.ToAndroid(), PorterDuff.Mode.SrcAtop); #else var colorFilter = new BlendModeColorFilter(element.LineColor.ToAndroid(), BlendMode.SrcAtop); Control.Background.SetColorFilter(colorFilter); #endif }
private void SetImageOnEntry(Drawable drawable) { var editText = Control; switch (Effect.Alignment) { case ImageAlignment.Left: editText.SetCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null); break; case ImageAlignment.Right: editText.SetCompoundDrawablesWithIntrinsicBounds(null, null, drawable, null); break; } editText.CompoundDrawablePadding = 25; #if MONOANDROID10_0 var colorFilter = new BlendModeColorFilter(Effect.LineColor.ToAndroid(), BlendMode.SrcAtop); Control.Background.SetColorFilter(colorFilter); #else Control.Background.SetColorFilter(Effect.LineColor.ToAndroid(), PorterDuff.Mode.SrcAtop); #endif }