Author Topic: Key Navigation on Scroll View  (Read 3613 times)

tr1stan

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Key Navigation on Scroll View
« on: August 28, 2014, 02:42:43 AM »
Hey guys,

What's the proper strategy to use Key navigation if I'm dealing with scroll view? I have a list of buttons which is dynamically generated at runtime under that scroll view, how can I navigate through those individual buttons with keyboard?


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Key Navigation on Scroll View
« Reply #1 on: August 28, 2014, 09:03:25 PM »
Button navigation is simple enough with UIKeyNavigation, but I'm assuming you want to scroll the scroll view as well. Knowing the UICamera.selectedObject you can calculate its position and check -- UIPanel.IsVisible? If not, center the scroll view on that position (easiest, SpringPanel.Begin) or move it in that direction (a bit more difficult).