Author Topic: [Question] some questions about scroll view  (Read 12733 times)

gyd

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 87
    • View Profile
[Question] some questions about scroll view
« on: January 08, 2016, 01:50:34 PM »
1.as the first image, the black is the scrollview's clip range, and the red is a item that tweenHeight to be a larger one.

assume the start position is set in the center to match this question like A.
if i use a fake Press/Drag call and release with no drag amount, it will spring in and stop like C.
how to make the spring effect stop like B?

2. same as 1, how to spring a scroll view's content to the end/start manual?

3. is any why to check if a scroll bar of a scroll view should be shown?
i wanna to create a chat window and auto scroll to value 1 when get a new message. but only when the messages are as many as scroll needed, so i can't set the scroll bar's value to 1 everytime.

4. same as 3, when a user is scrolling back to read the old messages, at this time if a new message is received i don't want to set the value to 1.
i can't just check the scrollbar's value is equal to 1 or not, because when i scroll to the bottom of a scroll bar, the value will be 0.99XXX instead of 1.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: [Question] some questions about scroll view
« Reply #1 on: January 09, 2016, 10:45:19 AM »
Don't use fake anything. Use SpringPanel.Begin to tween the position of the scroll view where you want it to be.

gyd

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 87
    • View Profile
Re: [Question] some questions about scroll view
« Reply #2 on: January 09, 2016, 03:30:41 PM »
how about Q3 & Q4?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: [Question] some questions about scroll view
« Reply #3 on: January 11, 2016, 04:55:06 PM »
3. UIScrollView.shouldMoveHorizontally and UIScrollView.shouldMoveVertically.

4. It sounds like you should just be using SpringPanel.Begin to move to some target position as I mentioned. There is no need to mess with scroll bars for you. A message arrives -- fine, just move the scroll view using SpringPanel.Begin.

gyd

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 87
    • View Profile
Re: [Question] some questions about scroll view
« Reply #4 on: January 13, 2016, 04:46:39 AM »
thanks for the reply.
it's my bad, i misunderstanding about the definition of shouldMoveVertically/shouldMoveHorizontally