summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.iOS
diff options
context:
space:
mode:
authorPaul DiPietro <pauldipietro@users.noreply.github.com>2016-10-20 20:17:00 (GMT)
committerGitHub <noreply@github.com>2016-10-20 20:17:00 (GMT)
commit8d035988123720fce35a0cc294b4b50686412c5e (patch)
tree15a3d0e37d58e5871879318fb4cc1f550c728af1 /Xamarin.Forms.Platform.iOS
parent4042f39f0007dd80f6ca3f8273e4cc155cf8123c (diff)
downloadxamarin-forms-8d035988123720fce35a0cc294b4b50686412c5e.zip
xamarin-forms-8d035988123720fce35a0cc294b4b50686412c5e.tar.gz
xamarin-forms-8d035988123720fce35a0cc294b4b50686412c5e.tar.bz2
[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.cs9
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 04eb6d4..6c75587 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();