public static void ColorBackround(this UITextField txt, UIView viewColor, bool animation = false) { txt.ShouldBeginEditing += textField => { if (animation) { viewColor.AnimationShake(); } if (textField.Tag == 0) { viewColor.BackgroundColor = viewColor.BackgroundColor.ColorWithAlpha(1f); } return(true); }; txt.ShouldEndEditing += textField => { if (textField.Tag == 0) { viewColor.BackgroundColor = viewColor.BackgroundColor.ColorWithAlpha(0.4f); } return(true); }; }