Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [iOS] Add SafeArea support * [iOS] Only apply SafeArea on iOS11 or newer * [iOS] Handle SafeAreaInsets on ViewCell and GroupCell * [iOS] Set page padding from safe area * [Controls] Use SafeArea PS * [iOS] Add platform specific for LargeTiles * [iOS] Add LargeTitleDisplayMode platform specific for ios11 * [iOS] Fix page size when large title collapses * [iOS] Add platform specific to expose SafeAreaInsets from iOS11 * [Controls] Large titles iOS specific gallery page * [iOS] Remove comment code on PS example * [Controls] Add gallery sample for Safe Area PS * [iOS] Inside a TabbedPage safe area bottom is handle by UITabViewController * [Core,iOS]If we are not using safearea set the padding to the default * [iOS] Revert SafeAreas on navpage * [iOS] Fix safe area inset for ViewCell * [iOS] Handle ViewCell margin correctly on iOS11 * [Core,iOS] Rename to UsingSafeArea, use BPKey instead for SafeAreaInsets * [Core,iOS] Rename to UsingLargeTitles * [iOS,Core] Rename to PrefersLargeTitles
- Loading branch information
Showing
18 changed files
with
1,244 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
59 changes: 59 additions & 0 deletions
59
Xamarin.Forms.Controls/GalleryPages/PlatformSpecificsGalleries/LargeTitlesPageiOS.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
using System; | ||
using System.Windows.Input; | ||
using Xamarin.Forms.PlatformConfiguration; | ||
using Xamarin.Forms.PlatformConfiguration.iOSSpecific; | ||
|
||
namespace Xamarin.Forms.Controls.GalleryPages.PlatformSpecificsGalleries | ||
{ | ||
public class LargeTitlesPageiOS : ContentPage | ||
{ | ||
public LargeTitlesPageiOS(ICommand restore) | ||
{ | ||
Title = "Large Titles"; | ||
|
||
var offscreenPageLimit = new Label(); | ||
var content = new StackLayout | ||
{ | ||
VerticalOptions = LayoutOptions.Fill, | ||
HorizontalOptions = LayoutOptions.Fill, | ||
Children = | ||
{ | ||
new Button | ||
{ | ||
Text = "LargeTitleDisplayMode.Never", | ||
Command = new Command(() => On<iOS>().SetLargeTitleDisplay(LargeTitleDisplayMode.Never)) | ||
}, | ||
new Button | ||
{ | ||
Text = "LargeTitleDisplayMode.Always", | ||
Command = new Command(() => On<iOS>().SetLargeTitleDisplay(LargeTitleDisplayMode.Always)) | ||
}, | ||
new Button | ||
{ | ||
Text = "LargeTitleDisplayMode.Automatic -> next page will have same LargeTitleDisplayMode as this one", | ||
Command = new Command(async () =>{ | ||
var page = new ContentPage { Title = "Page Title" }; | ||
page.On<iOS>().SetLargeTitleDisplay(LargeTitleDisplayMode.Automatic); | ||
await Navigation.PushAsync(page); | ||
} ) | ||
}, | ||
new Button | ||
{ | ||
Text = "Tooggle UseLargeTitles on Navigation", | ||
Command = new Command( () =>{ | ||
var navPage = (Parent as NavigationPage); | ||
navPage.On<iOS>().SetPrefersLargeTitles(!navPage.On<iOS>().PrefersLargeTitles()); | ||
} ) | ||
}, | ||
offscreenPageLimit | ||
} | ||
}; | ||
|
||
var restoreButton = new Button { Text = "Back To Gallery" }; | ||
restoreButton.Clicked += async (sender, args) => await Navigation.PopAsync(); | ||
content.Children.Add(restoreButton); | ||
|
||
Content = content; | ||
} | ||
} | ||
} |
Oops, something went wrong.