Search Unity

Bug ScrollView Show Horizontal Scrollbar is unchecked but it appears anyway in some circumstances

Discussion in 'UI Toolkit' started by manuelgoellnitz, Sep 8, 2020.

  1. manuelgoellnitz

    manuelgoellnitz

    Joined:
    Feb 15, 2017
    Posts:
    397
    I have a ScrollView with "Mode = Vertical" and the Show Vertical and Hoizontal Scrollbar checboxes are unchecked.

    When I start the app it works fine, no scrollbars and if the page gets to large the vertical scrollbar appears.

    The whole Scrollview can be disabled with "display = none".

    When I disable it, change the scene and reenable it, the horizontal scrollbar appears.
    The width is still not larger then the scrollview, so there is no need for it.
     
  2. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    700
    Hello @manuelgoellnitz , I have tried to reproduce this issue here but wasn't able. If you still have issues and think this is a bug can you report a bug (Help > Report bug) and send in assets that we can use to troubleshoot it?

    If you're not sure it's a bug, please comment here with more details (like some assets, for example) so we can discuss it further :)
     
  3. manuelgoellnitz

    manuelgoellnitz

    Joined:
    Feb 15, 2017
    Posts:
    397
    Unfortunatelly I can't give you some assets since it is part of a large project.

    But today I also discovered this bug in the UIBuilder as well. I don't recall waht I ecactly did, I moved a Element With a ScrollView around and the horizontal scrollbar appeared suddenly (no need, no checkbox in the scrollview checked)
     
  4. nixarn_

    nixarn_

    Joined:
    Jul 25, 2015
    Posts:
    42
    I had the same thing happening to me. Two other weird issues: When I set it to elastic, whenever I saved it (in the UI builder) it revered that setting. I made a vertical list using it, everything worked well in the editor (in play mode) but running on Android it scrolled in both directions. Although seems like ScrollView isn't mobile friendly at all, so switching to ListView for now.
     
  5. manuelgoellnitz

    manuelgoellnitz

    Joined:
    Feb 15, 2017
    Posts:
    397
    ListView uses ScrollView internally, so I don't think that changes that behavior.
     
  6. uMathieu

    uMathieu

    Unity Technologies

    Joined:
    Jun 6, 2017
    Posts:
    398
    As of now, ScrollView's "show-horizontal-scroller" attribute only forces the the scroller to be displayed even when content is not overflowing, not the otherway around. Setting it to false will lead to the default behavior where scrollers will appear then content is outside of the viewed area and hide when the content fits.
     
    nixarn_ likes this.
  7. nixarn_

    nixarn_

    Joined:
    Jul 25, 2015
    Posts:
    42
    Yeah, true. Decided I'll wait with UIToolkit a few months still. Too early still to use on mobile, but really promising. It's UI done right for sure.

    Ah ok, that would explain it! Thanks
     
    uMathieu likes this.