Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Shell content padding on iOS default #5927

Open
davidortinau opened this Issue Apr 16, 2019 · 1 comment

Comments

Projects
4 participants
@davidortinau
Copy link
Contributor

davidortinau commented Apr 16, 2019

Safe Area Spec

  • Don't use the platform specific UseSafeArea API with Shell it doesn't make any sense to have this ios specific API
  • SetPaddingInsets(true) should be the default value
  • SetPaddingInsets(false) on Android and iOS should cause the content to flow underneath the nav bar so the page offset is at 0,0
  • SetPaddingInsets API name is confusing and if anything we should just call it "UseSafeAreaInsets" and then we can emulate how this works on iOS to Android
  • "UseSafeAreaInsets" should be settable on Shell and ContentPage

David's original issue below

Description

This issue has been filed 3 or 4 times already and it came up just now from a new developer on Twitter. To me this indicates an API design that needs to be improved.

#4342
#5811
#4840

Out of the box, content is shoved underneath the NavigationBar TabBar. It seems the expectation is that content would appear below the NavigationBar and above the TabBar while scrolling behind them.

  1. I suggest this should be the default in Shell.

  2. Nobody is looking for Shell.SetPaddingInsets and more importantly it doesn't seem to be named consistently with the rest of the Shell API at least in terms of what we expose in XAML. Nothing else is a Set_____.

  3. We should not have to add anything to the templates to get this expected default

What's the difference between SetPaddingInsets and the iOS UseSafeArea?

Steps to Reproduce

File > New > Shell template. Run on iOS. Observe the content is under the navigation bar.

Yes ScrollView and ListView will adapt as desired, but I think we can do better.

Basic Information

  • Version with issue: 4.0-pre8
  • Platform Target Frameworks:
    • iOS: 12.1

Screenshots

Screenshot 2019-04-15 20 45 33

<?xml version="1.0" encoding="utf-8"?>
<ContentPage
    xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    x:Class="TopScrollTest.Views.ItemsPage"
    Title="{Binding Title}"
    x:Name="BrowseItemsPage">
    <ContentPage.ToolbarItems>
        <ToolbarItem
            Text="Add"
            Clicked="AddItem_Clicked" />
    </ContentPage.ToolbarItems>
    <StackLayout>
        <ListView
            x:Name="ItemsListView"
            ItemsSource="{Binding Items}"
            VerticalOptions="FillAndExpand"
            HasUnevenRows="true"
            RefreshCommand="{Binding LoadItemsCommand}"
            IsPullToRefreshEnabled="true"
            IsRefreshing="{Binding IsBusy, Mode=OneWay}"
            CachingStrategy="RecycleElement"
            ItemSelected="OnItemSelected">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <ViewCell>
                        <StackLayout
                            Padding="10">
                            <Label
                                Text="{Binding Text}"
                                LineBreakMode="NoWrap"
                                Style="{DynamicResource ListItemTextStyle}"
                                FontSize="16" />
                            <Label
                                Text="{Binding Description}"
                                LineBreakMode="NoWrap"
                                Style="{DynamicResource ListItemDetailTextStyle}"
                                FontSize="13" />
                        </StackLayout>
                    </ViewCell>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
    </StackLayout>
</ContentPage>
@samhouts

This comment has been minimized.

Copy link
Member

samhouts commented Apr 16, 2019

Yep, let's do it.

@samhouts samhouts added this to To do in Sprint 152 via automation Apr 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.