Author Topic: UIScrollView  (Read 127025 times)

porchin

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: UIScrollView
« Reply #120 on: January 30, 2015, 09:44:46 AM »
I'm using NGUI version 3.7.6p2 I think. It should be up-to-date enough, isn't it? Could you please check it again or do I set anything wrong?


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: UIScrollView
« Reply #121 on: January 30, 2015, 03:13:13 PM »
@porchin: 376 is from November last year, so it's quite old now.

@Plimsky: You can set two scroll bars and Unrestricted movement no problem, but the scroll wheel will move both X and Y in this case. You would need to either modify the UIScrollView script to change this, or to set the Scroll Wheel Factor to 0 and write your own handler for the scrollwheel.

porchin

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: UIScrollView
« Reply #122 on: February 02, 2015, 12:31:39 AM »
Thanks! Aren. Got it :D

I'd like to ask more question, about UICenterChild's next page threshold. Can I do similar thing without using UIGrid?
I want my scroll view items to have gap between each others + have a threshold for scroll view to snap to the next item not to scroll to half way to make it snap to the next item.

Sorry for my bad English.
« Last Edit: February 02, 2015, 12:38:36 AM by porchin »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: UIScrollView
« Reply #123 on: February 02, 2015, 01:44:09 AM »
I don't quite understand what you mean. The grid isn't necessary, it simply repositions the objects underneath it. You can remove it and position objects yourself if you prefer. To add padding to the scroll view, use invisible widgets to provide a larger covered area -- ALT+SHIFT+W.

porchin

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: UIScrollView
« Reply #124 on: February 02, 2015, 04:25:22 AM »
Normally UICenterOnChild will snap to the 2nd item if we scroll to more than half way between 2 items to get the 2nd item be "the nearest item" to snap right? I want to scroll only a bit, pass the threshold, to make scroll view snap to 2nd item like nextPageThreshold in UICenterOnChild does.

dttngan91

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: UIScrollView
« Reply #125 on: February 02, 2015, 05:44:48 AM »
I have a issue deal with NGUI Scroll view performance in case of loading a list of nearly 500 items.
Currently, I loaded all items at the first time load game.Thus, I only enable the items which are viewed on camera space and disable the others. But when scrolling faster, it still jerky (not smooth) with really bad performance. Is there another ways to address this issue?



ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: UIScrollView
« Reply #126 on: February 03, 2015, 11:12:40 AM »
You should let NGUI do the culling for you, not doing it yourself. UIPanel has an option "Cull". Also, 500 items is quite a lot. When scrolling, things come into view quite often, and you enabling/disabling things causes them to get added/removed from lists, causing the entire lists to be re-sorted. You may want to consider splitting up your content into different pages or categories.

Xaren

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: UIScrollView
« Reply #127 on: February 10, 2015, 01:46:39 PM »
Is there any way to find out if the Scrollview is at the bottom. Scrollbar value doesn't seem to be "1" after the user has moved it to the bottom.

(I want to detect that if the scrollbar is at the bottom, it should stay there when adding new object to it, but if it's not at the bottom, it should retain that position)

Thanks !

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: UIScrollView
« Reply #128 on: February 11, 2015, 09:52:59 PM »
Doesn't seem to be? It should be. Scroll bar's value ranges from 0 to 1 depending on the scrolled amount.

Xaren

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: UIScrollView
« Reply #129 on: February 17, 2015, 09:51:16 AM »
I was able to work with :

myScrollView.verticalScrollBar.value but even then, sometimes the value is 0.99XXXXX

(I was able to make it work, but it feel more like a patch than anything else)

Finch

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Re: UIScrollView
« Reply #130 on: February 25, 2015, 10:22:17 AM »
[solved]
I just solved this problem when i saw the same problem other person asked.
http://www.tasharen.com/forum/index.php?topic=4929.0

Original post
-----------------------------------------------------------------------------------------------------------------------------------
Sorry for my bad English.

I have an issue with UIScrollView.scrollView when scrollView value was changed.
Now, I have two different kinds of ScrollView, Horizontal scrollView for horizontal swipe, and vertical scrollView for vertical swipe.

Then I have a script called GestureSelection to change UIDragScrollView.ScrollView. But when scrollview value was changed,
the last scrollView jump to current touch point.






I hope you understand what i'm talking about. Sorry for my bad English again :'(.
« Last Edit: February 26, 2015, 11:03:04 AM by Finch »

spbsmile

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: UIScrollView
« Reply #131 on: March 05, 2015, 10:10:04 AM »
Hello !
 help, me)
 when i set UnityEngine.Time.timeScale = 0.0001;
 start delay from  UIScrollView.
how solved it ?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: UIScrollView
« Reply #132 on: March 05, 2015, 10:29:26 PM »
Start delay of what?

subliminalman

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: UIScrollView
« Reply #133 on: April 24, 2015, 06:47:02 PM »
Is there a way to shift the upper bounds on a ScrollView to the center? I know there Center on child but I don't want it to "magnetize" to each button. I want the ScrollView to stop at the middle when it reaches it's first and last item instead of stopping at it's bounds.

[SOLVED]
I did this by unchecking Restrict Within Panel and doing my own clamp on the position and offset in an Update loop.
« Last Edit: April 27, 2015, 03:22:34 PM by subliminalman »

Mourkain

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: UIScrollView
« Reply #134 on: February 09, 2016, 10:43:39 AM »
I have two different ScrollViews. Both with 5 Items. One with Words and one with BackgroundImages for each word. When I center one of the Words, I call BackgroundImages.centerOn that Word.

This works good, when I go from word 2->3 or 3->4 or 3->5, but when I go from 4->1 it goes backwards, instead of forward, because I think centerOn takes the shortest way to the target.

Is there a way that it goes the same direction the WordScollView goes and not the shortest way or do I have to modify the UICenterOnChild for this?

Cheers,
Mourkain