I have a custom entry with a custom renderer. In PCL, I'm handling entry.Focused()
event for all platforms. In Android custom renderer, I'm setting some styles for the entry:
Control.Gravity = GravityFlags.CenterVertical;
Control.SetPadding(20, 0, 0, 0);
Control.Background = null;
The problem is when entry gets focus for the first time, gravity gets disabled for a second and then re-enabled. I found out that handling Control.FocusChange()
and setting gravity there in addition to OnElementChanged()
fixes the problem. Now the question is, is it possible to handle this event while also handling entry.Focused()
? Is there another workaround?