Can I control the distance of scroll to in scrollView ?

Hi All,

The scroll to function allow to scroll right , left ,  etc … but the issue it goes to the end of the scrollView. Is it possible to make it go the right for example by certain amount??.. i want to make pictures in the scrollView and i want to show only one picture in the scrollView… i want to allow user to click on a button to show next picture and click on another button to show previous picture… please advice… 

[lua]

scrollView = widget.newScrollView

      {

          top = 300,

          left = 300,

          width = 400,

          height = 120,

          scrollWidth = 50,

          --scrollHeight = 200,

          backgroundColor = { 0.8, 0.8, 0.8 },

          verticalScrollDisabled =true,

          listener = scrollListener

      }

      scrollView.x = _W /4

      scrollView.y = _H /4

    local function scrollR()

      scrollView:scrollTo( “right”, { time=500 })

      print( “Scroll complete!” )

    end

    local function scrollL()

      scrollView:scrollTo( “left”, { time=500 })

      print( “Scroll complete!” )

    end

    

    local scrollRight = display.newText( “scroll right”, 300,100,system.nativeFont, 50 )

    scrollRight:addEventListener( “tap”, scrollR )

    local scrollLeft = display.newText( “scroll Left”, 300,150,system.nativeFont, 50 )

    scrollLeft:addEventListener( “tap”, scrollL )

[/lua]

Regards

Abdulaziz

Hi Abdulaziz,

Yes, please see the documentation on ScrollView for a list of related functions:

http://docs.coronalabs.com/api/library/widget/newScrollView.html

Specifically:

http://docs.coronalabs.com/api/type/ScrollViewWidget/scrollToPosition.html

Take care,

Brent

Thanks for help sir,

Abdul

Hi Abdulaziz,

Yes, please see the documentation on ScrollView for a list of related functions:

http://docs.coronalabs.com/api/library/widget/newScrollView.html

Specifically:

http://docs.coronalabs.com/api/type/ScrollViewWidget/scrollToPosition.html

Take care,

Brent

Thanks for help sir,

Abdul