Skip to content

Scrollbars and Safearea on iOS #25802

Open

Description

@goderbauer

Looking at an iOS native Scrollview (e.g. Safari or Mailbox in Mail) in landscape on an iPhone Xs you will see the following behavior:

  • When the notch is on the left, the scrollbar is drawn all the way at the right edge of the screen (the content of the scrollview does not go all the way to the right to avoid potential obtrusion by the round corners)
  • When the notch is on the right, the scrollbar is not drawn all the way to the right and instead slightly indented (just like the content) to avoid the notch

I believe I cannot easily replicate this behavior with the Safearea and Scrollbar widget in Flutter. Either the scrollbar is always (regardless of notch orientation) drawn with a padding from the edge of the screen (and would avoid the notch if the phone is orientated to have the notch on the right) or the scrollbar is always drawn all the way at the screen edge (and thus obstructed by the notch if it happened to be on the right side).

Activity

  1. added
    platform-iosiOS applications specifically
    a: fidelityMatching the OEM platforms better
    p: cupertino_uicupertino_ui package in flutter/packages
    on Dec 27, 2018
  2. goderbauer commented on Dec 27, 2018

    @goderbauer
    MemberAuthor
  3. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Dec 27, 2018
  4. matthew-carroll commented on Apr 9, 2019

    @matthew-carroll
    Contributor

    @goderbauer would you mind posting comparable screenshots showing what we do vs what the standard platform behavior looks like?

  5. tomgilder commented on Apr 11, 2019

    @tomgilder
    Contributor

    Here's the standard platform behaviour - will show what Flutter does later :-)

    Note that this isn't just a landscape thing.

    iOS Scrollbar behavior

  6. tomgilder commented on Apr 11, 2019

    @tomgilder
    Contributor

    Note that in the iOS example above, I didn't have to do anything - UIKit provides the behaviour for free by adjusting the scrollIndicatorInsets automatically.

    This example wraps the content in a SafeArea:
    Flutter with SafeArea

    This one doesn't use a SafeArea, but has padding on the content:
    Flutter without SafeArea

  7. matthew-carroll commented on Apr 11, 2019

    @matthew-carroll
    Contributor

    @tomgilder thanks for posting the examples.

    CC @xster @LongCatIsLooong

  8. xster commented on Apr 11, 2019

    @xster
    Member

    Leaving this bug open but I think it's mostly a dupe of #13253 where accounting for the MediaQueryData.padding in the thumb paint calculation will solve.

  9. goderbauer commented on Apr 12, 2019

    @goderbauer
    MemberAuthor

    I think the issue I had was slightly different. Look at the location of the scrollbar in safari: If there is no notch, the scrollbar is as far to the edge of the screen as possible. If there is a notch, the scrollbar is placed with a padding to avoid the notch:

    native

    As far as I can tell, there is no way to get that behavior easily in flutter. You either have a padding wether or not there is a notch, or there is never padding and the scrollbar goes through the notch. Example from Flutter gallery:

    flutter

  10. xster commented on Apr 16, 2019

    @xster
    Member

    You're right, I think there is an additional problem indeed. Looking at iOS, it seems like on opposite side of the notch in landscape mode actually has 2 paddings. The nav bar menus, list cell items, tab bar etc all have one padding and the scrollbar has another.

    Screen Shot 2019-04-15 at 9 17 35 PM

    This could be tricky to handle since we already defined the padding and viewInset metrics and the framework doesn't have any additional information from the engine to split 2 different types of padding by reading https://developer.apple.com/documentation/uikit/uiview/2891103-safeareainsets.

  11. TahaTesser commented on Mar 13, 2020

    @TahaTesser
    Contributor

    Hi @goderbauer
    Is this issue still valid?
    Thank you

  12. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Mar 13, 2020
  13. 8 remaining items

  14. SaadArdati commented on Dec 22, 2022

    @SaadArdati

    This issue still happens in 2022. In a horizontal iPhone 13, the SafeArea thinks the notch is on the right side when it is on the left side and vice-versa.

  15. shahmirzali49 commented on Nov 23, 2023

    @shahmirzali49

    any progress ?

  16. added
    packageflutter/packages repository. See also p: labels.
    and removed
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: fidelityMatching the OEM platforms bettera: layoutSystemChrome and Framework's Layout Issuesf: scrollingViewports, list views, slivers, etc.p: cupertino_uicupertino_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.platform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions