Author Topic: Many different issues with ScrollView  (Read 4162 times)

DanjelRicci

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
  • Speed Addict
    • View Profile
    • SpeedGraphX Dev Diary
Many different issues with ScrollView
« on: April 06, 2014, 09:01:45 AM »
Hello, looks like I have some problems with the UIScrollView (and maybe with the UIGrid component too):

- The list gets created with a big empty space on top, but if I click on the scrollbar, the list fits correctly. UIGrid Pivot is already set to TopLeft.
- I selected Alphabetical sorting, but the items are placed kinda randomly. In the scene Hierarchy, instead, they are sorted correctly.
- All the items seem to have an offset of 1 pixel to the right.
- I can't find a way to have hard clipping, there is always at least 1 pixel of alpha clipping.
- The scrollwheel isn't scrolling the list.



This is the hierarchy of the objects:

-ListPositions (just a container)
--Grid_PositionsList (UIPanel, UIGrid, UIScrollView)
---Item1 (UIDragScrollView, BoxCollider)
---Item2 (UIDragScrollView, BoxCollider)
---Item3 (UIDragScrollView, BoxCollider)

...and so on until Item12.
I updated NGUI just today and already set up the new parameters like the UIGrid Pivot, but I don't understand why it's not working as it should. I started having problems with ScrollViews from version 3.

Thanks for the help!

Caio.Lib

  • Newbie
  • *
  • Thank You
  • -Given: 7
  • -Receive: 2
  • Posts: 26
    • View Profile
Re: Many different issues with ScrollView
« Reply #1 on: April 06, 2014, 11:36:12 AM »
Hi, I had some of these problems too, what i did:

Scroll view's hierarchy:
- Scroll View ( UIScroll View )
-- Scroll Container ( Box Collider, UITable in my case, UIDrag Scroll View )
--- 01 Items
--- 02 Items

- The list gets created with a big empty space on top, but if I click on the scrollbar, the list fits correctly. UIGrid Pivot is already set to TopLeft.
I changed UIScroll View's Content Origin to another value, then returned to TopLeft and fixed the problem.

- I selected Alphabetical sorting, but the items are placed kinda randomly. In the scene Hierarchy, instead, they are sorted correctly.
I'm using scene hierarchy sorting too.

- All the items seem to have an offset of 1 pixel to the right.
- I can't find a way to have hard clipping, there is always at least 1 pixel of alpha clipping.

I don't know, in my case UITable has an Advanced Anchor for Scroll View only for Left and Right.
The items have Anchors Unified for Scroll Container.

- The scrollwheel isn't scrolling the list.
Use UIDrag Scroll View.

Hope it help!

coolaneasy

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 34
    • View Profile
Re: Many different issues with ScrollView
« Reply #2 on: July 10, 2014, 08:44:26 PM »
I had similar space at top problem. While I fixed it somehow by tinkering with it a lot. The first scroll on the content brings in the empty space at top.
Seems like an ngui bug. Thoughts Aren??

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Many different issues with ScrollView
« Reply #3 on: July 10, 2014, 09:43:23 PM »
You're creating your content starting in the middle, likely by adding a child UIGrid underneath the scroll view and then populating it. Unless you move this grid upwards, or call ResetPosition on the scroll view, it won't magically move for you without some user interaction. Changing the content origin forces the scroll view to ResetPosition. Same can be done by calling Execute via the right-click menu.
Quote
- All the items seem to have an offset of 1 pixel to the right.
Check the padding setting on the panel. If it's 1 pixel, then expect a 1 pixel offset.
Quote
- I can't find a way to have hard clipping, there is always at least 1 pixel of alpha clipping.
Then your NGUI is out of date and you should update. 0 pixel clipping has been an option for quite some time now.