Last active
April 24, 2017 11:31
-
-
Save Stayrony/b8998db9d4f594b8661e68f8f3917f3d to your computer and use it in GitHub Desktop.
Xamarin Android Letter Spacing Label Renderer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LetterSpacingLabelRenderer : LabelRenderer | |
{ | |
protected LetterSpacingLabel LetterSpacingLabel { get; private set; } | |
protected override void OnElementChanged(ElementChangedEventArgs<Label> e) | |
{ | |
base.OnElementChanged(e); | |
if (e.OldElement == null) | |
{ | |
this.LetterSpacingLabel = (LetterSpacingLabel)this.Element; | |
} | |
var letterSpacing = this.LetterSpacingLabel.LetterSpacing; | |
this.Control.LetterSpacing = letterSpacing; | |
this.UpdateLayout(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment