Home / Topic / More than one scrollview

More than one scrollview

Home Kwiksher Forums Help me! More than one scrollview

Viewing 5 posts - 1 through 5 (of 5 total)
  • susa38
    Participant
    #84279

    Hello.
    Is not possible to insert more than one scroll view on a page?

    Yamamoto
    Keymaster
    #84280

    In this sample, I used two scroll views

    Scroll Objects and Text Replacement (Beginner)

    susa38
    Participant
    #84281

    Thanks Yamamoto. I have been looking for the solution and why in your sample it works and for me do not works.

    The problem I think is that I have two scrollviews and I want to show them on all the screen.
    Under each scrollview I have an image that his width is all the screen width and is higher that the screen.
    so the user can scroll the images vertically

    Initially the 2 images are hidden
    Then I have a button to show one and a button to hide it
    Other button to show the image 2 and other to hide the image 2
    I create one scrollview for the image1 and other for the image2

    The problem is that only 2 second scroll view created on the code works.
    Why? I think because the first scrollview are over the second one and it’s not possible. (the 2 scrollview have the same width and position)
    If you try on your example to create 2 scrollviews for 2 images and the scrollview with same width and position it does not work (for me do not work)

    The solution form me is to go to the code and create the scrollview when the user press the button to show the image1 (initially hidden) and the same for the second image.

    I go to create a external code with the “create scrollview code” and call this external code when I create the button on kwiksher.

    I have been on the coronas forums asking for it
    https://forums.coronalabs.com/topic/60188-more-than-one-scrollview/

    IF you think a better solution or that my solution is not good please comment to me.
    And if I get other solution I will post here. thanks a lot

    my solution ( I do not create the scroll object with the kwik scrollview button, I create it with external code when the user press a button) …

    -- Button functions 
           function but_open1(self) 
     -- Scroll object
           layer.scroll_image1 = widget.newScrollView { 
              top = 5, left = 0,  
              width = 2000, height = 1536,   
              scrollWidth = 2000, scrollHeight = 12000,  
              hideBackground = true,  
           } 
           sceneGroup:insert( layer.scroll_image1) 
           layer.scroll_image1:insert(layer.image1) 
                  composer.trans.newTransition_195 = transition.to( layer.closeimage1, {alpha=layer.closeimage1.oldAlpha, time=1000, delay=0}) 
                  composer.trans.newTransition_196 = transition.to( layer.image1, {alpha=layer.image1.oldAlpha, time=1000, delay=0}) 
                  composer.trans.newTransition_196 = transition.to( layer.backimage1, {alpha=layer.backimage1.oldAlpha, time=1000, delay=0}) 
           end 
    
           function but_open2(self) 
    -- Scroll object
           layer.scroll_image2 = widget.newScrollView { 
              top = 15, left = 20,  
              width = 2000, height = 1536,   
              scrollWidth = 2000, scrollHeight = 2600,  
              hideBackground = true,  
           } 
           sceneGroup:insert( layer.scroll_image2) 
           layer.scroll_image2:insert(layer.image2) 
                  composer.trans.newTransition_197 = transition.to( layer.closeimage2, {alpha=layer.closeimage2.oldAlpha, time=1000, delay=0}) 
                  composer.trans.newTransition_197 = transition.to( layer.image2, {alpha=layer.image2.oldAlpha, time=1000, delay=0}) 
                  composer.trans.newTransition_197 = transition.to( layer.backimage2, {alpha=layer.backimage2.oldAlpha, time=1000, delay=0}) 
           end 
    Yamamoto
    Keymaster
    #84282

    Instead of creating scroll views each time, how about translating the other scroll view off screen and the target scroll view sets in the right position?

    susa38
    Participant
    #84283

    Ohhh fantastic solution Yamamoto.
    Always the simple way is the best..
    thanks a lot

Viewing 5 posts - 1 through 5 (of 5 total)

The forum ‘Help me!’ is closed to new topics and replies.