diff options
author | Paul DiPietro <pauldipietro@users.noreply.github.com> | 2016-10-20 15:17:00 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-20 15:17:00 -0500 |
commit | 8d035988123720fce35a0cc294b4b50686412c5e (patch) | |
tree | 15a3d0e37d58e5871879318fb4cc1f550c728af1 /Xamarin.Forms.Platform.iOS | |
parent | 4042f39f0007dd80f6ca3f8273e4cc155cf8123c (diff) | |
download | xamarin-forms-8d035988123720fce35a0cc294b4b50686412c5e.tar.gz xamarin-forms-8d035988123720fce35a0cc294b4b50686412c5e.tar.bz2 xamarin-forms-8d035988123720fce35a0cc294b4b50686412c5e.zip |
[iOS] Add Platform Specific feature for setting AdjustsFontSizeToFitWidth on Entry (#429)
* [iOS] Add Platform Specific feature for setting AdjustsFontSizeToFitWidth on Entry
* Update docs
Diffstat (limited to 'Xamarin.Forms.Platform.iOS')
-rw-r--r-- | Xamarin.Forms.Platform.iOS/Renderers/EntryRenderer.cs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/EntryRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/EntryRenderer.cs index 04eb6d4f..6c75587e 100644 --- a/Xamarin.Forms.Platform.iOS/Renderers/EntryRenderer.cs +++ b/Xamarin.Forms.Platform.iOS/Renderers/EntryRenderer.cs @@ -3,6 +3,7 @@ using System.ComponentModel; using System.Drawing; using UIKit; +using Xamarin.Forms.PlatformConfiguration.iOSSpecific; namespace Xamarin.Forms.Platform.iOS { @@ -62,6 +63,7 @@ namespace Xamarin.Forms.Platform.iOS UpdateFont(); UpdateKeyboard(); UpdateAlignment(); + UpdateAdjustsFontSizeToFitWidth(); } } @@ -90,6 +92,8 @@ namespace Xamarin.Forms.Platform.iOS UpdateColor(); UpdatePlaceholder(); } + else if (e.PropertyName == PlatformConfiguration.iOSSpecific.Entry.AdjustsFontSizeToFitWidthProperty.PropertyName) + UpdateAdjustsFontSizeToFitWidth(); base.OnElementPropertyChanged(sender, e); } @@ -137,6 +141,11 @@ namespace Xamarin.Forms.Platform.iOS Control.TextColor = textColor.ToUIColor(); } + void UpdateAdjustsFontSizeToFitWidth() + { + Control.AdjustsFontSizeToFitWidth = Element.OnThisPlatform().AdjustsFontSizeToFitWidth(); + } + void UpdateFont() { Control.Font = Element.ToUIFont(); |