Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Kaz32
Posts: 235
Registered: ‎11-24-2012
My Device: Blackberry 10 Dev Alpha
My Carrier: Telkomsel
Accepted Solution

How to change scrollViewProperties scrollMode from vertical to horizontal if screen orientation change from portrait to landscape

How to change scrollViewProperties scrollMode from vertical to horizontal if screen orientation change from portrait to landscape?

 

I try like this but not work

OrientationHandler {
   onOrientationAboutToChange: {
      if (orientation == UIOrientation.Landscape) 
         scrollViewId.scrollMode = ScrollMode.Horizontal; // scrollViewId -> id of scrollView
      else
         scrollViewId.scrollMode = ScrollMode.Vertical;
   }
}

 

Thanks

Please use plain text.
Developer
Kaz32
Posts: 235
Registered: ‎11-24-2012
My Device: Blackberry 10 Dev Alpha
My Carrier: Telkomsel

Re: How to change scrollViewProperties scrollMode from vertical to horizontal if screen orientation change from portrait to landscape

Hi I changed the code like this and work

 

OrientationHandler {
   onOrientationAboutToChange: {
      if (orientation == UIOrientation.Landscape) 

         scrollViewId.scrollViewProperties.scrollMode = ScrollMode.Horizontal;
      else

         scrollViewId.scrollViewProperties.scrollMode = ScrollMode.Vertical;
   }
}

Please use plain text.