summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls
diff options
context:
space:
mode:
authorPaul DiPietro <pauldipietro@users.noreply.github.com>2016-10-20 15:17:00 -0500
committerGitHub <noreply@github.com>2016-10-20 15:17:00 -0500
commit8d035988123720fce35a0cc294b4b50686412c5e (patch)
tree15a3d0e37d58e5871879318fb4cc1f550c728af1 /Xamarin.Forms.Controls
parent4042f39f0007dd80f6ca3f8273e4cc155cf8123c (diff)
downloadxamarin-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.Controls')
-rw-r--r--Xamarin.Forms.Controls/GalleryPages/PlatformSpecificsGalleries/EntryPageiOS.cs32
-rw-r--r--Xamarin.Forms.Controls/GalleryPages/PlatformSpecificsGallery.cs4
-rw-r--r--Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj1
3 files changed, 36 insertions, 1 deletions
diff --git a/Xamarin.Forms.Controls/GalleryPages/PlatformSpecificsGalleries/EntryPageiOS.cs b/Xamarin.Forms.Controls/GalleryPages/PlatformSpecificsGalleries/EntryPageiOS.cs
new file mode 100644
index 00000000..88936786
--- /dev/null
+++ b/Xamarin.Forms.Controls/GalleryPages/PlatformSpecificsGalleries/EntryPageiOS.cs
@@ -0,0 +1,32 @@
+using System;
+using Xamarin.Forms;
+using Xamarin.Forms.PlatformConfiguration;
+using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
+
+namespace Xamarin.Forms.Controls.GalleryPages.PlatformSpecificsGalleries
+{
+ public class EntryPageiOS : ContentPage
+ {
+ public EntryPageiOS()
+ {
+ var entry = new Entry
+ {
+ FontSize = 22,
+ Placeholder = "Type and toggle AdjustsFontSizeToFitWidth"
+ };
+
+ Content = new StackLayout
+ {
+ Children =
+ {
+ entry,
+ new Button
+ {
+ Text = "Toggle AdjustsFontSizeToFitWidth",
+ Command = new Command(() => entry.On<iOS>().SetAdjustsFontSizeToFitWidth(!entry.On<iOS>().AdjustsFontSizeToFitWidth()))
+ }
+ }
+ };
+ }
+ }
+}
diff --git a/Xamarin.Forms.Controls/GalleryPages/PlatformSpecificsGallery.cs b/Xamarin.Forms.Controls/GalleryPages/PlatformSpecificsGallery.cs
index 1bca68bb..2907d9b7 100644
--- a/Xamarin.Forms.Controls/GalleryPages/PlatformSpecificsGallery.cs
+++ b/Xamarin.Forms.Controls/GalleryPages/PlatformSpecificsGallery.cs
@@ -15,6 +15,7 @@ namespace Xamarin.Forms.Controls
var viselemiOSButton = new Button() { Text = "Visual Element (iOS)" };
var appAndroidButton = new Button() { Text = "Application (Android)" };
var tbAndroidButton = new Button { Text = "TabbedPage (Android)" };
+ var entryiOSButton = new Button() { Text = "Entry (iOS)" };
mdpWindowsButton.Clicked += (sender, args) => { SetRoot(new MasterDetailPageWindows(new Command(RestoreOriginal))); };
npWindowsButton.Clicked += (sender, args) => { SetRoot(new NavigationPageWindows(new Command(RestoreOriginal))); };
@@ -23,11 +24,12 @@ namespace Xamarin.Forms.Controls
viselemiOSButton.Clicked += (sender, args) => { SetRoot(new VisualElementiOS(new Command(RestoreOriginal))); };
appAndroidButton.Clicked += (sender, args) => { SetRoot(new ApplicationAndroid(new Command(RestoreOriginal))); };
tbAndroidButton.Clicked += (sender, args) => { SetRoot(new TabbedPageAndroid(new Command(RestoreOriginal))); };
+ entryiOSButton.Clicked += (sender, args) => { Navigation.PushAsync(new EntryPageiOS()); };
Content = new StackLayout
{
- Children = { mdpWindowsButton, npWindowsButton, tbWindowsButton, navpageiOSButton, viselemiOSButton, appAndroidButton, tbAndroidButton }
+ Children = { mdpWindowsButton, npWindowsButton, tbWindowsButton, navpageiOSButton, viselemiOSButton, appAndroidButton, entryiOSButton }
};
}
diff --git a/Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj b/Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj
index b1568398..4f560a1d 100644
--- a/Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj
+++ b/Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj
@@ -100,6 +100,7 @@
<DependentUpon>ControlTemplateXamlPage.xaml</DependentUpon>
</Compile>
<Compile Include="GalleryPages\LayoutPerformanceGallery.cs" />
+ <Compile Include="GalleryPages\PlatformSpecificsGalleries\EntryPageiOS.cs" />
<Compile Include="GalleryPages\PlatformSpecificsGalleries\MasterDetailPageWindows.cs" />
<Compile Include="GalleryPages\NavigationPropertiesGallery.cs" />
<Compile Include="ControlGalleryPages\ListViewSelectionColor.cs" />