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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Cascades Development

Reply
Developer
Kaz32
Posts: 145
Registered: ‎11-24-2012
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: 145
Registered: ‎11-24-2012
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.