UIScroller

Discussion in 'Jiggy Runtime Development' started by e.mann30, Jun 13, 2008.

  1. e.mann30

    e.mann30 New Member

    Joined:
    Nov 13, 2007
    Messages:
    427
    Likes Received:
    8
    I have a UI Scroller in my mainview2. Theres a top and bottom navbar in the mainview window. How do I get the UI Scroller to scroll just in between the two navbars ?

    Heres my setup

    var mainView2 = new UIScroller();
    mainView2.contentSize = [ window2.bounds[ 2 ] * 2 , window2.bounds[ 3 ] * 2 ];

    window2.setContentView( mainView2 );

    --------------------------------------------------------------------------------
  2. optimo

    optimo New Member

    Joined:
    Sep 28, 2007
    Messages:
    535
    Likes Received:
    17
    I'm not sure exactly what it would be in jiggy; but the scroller when you initialize it you have to subtract for the navbars...so for size you would take the maximum height 480 and subtract the height of the navbar. Then you have the true height of the scroller.


    mainView2.contentSize = [ window2.bounds[ 2 ] * 2 , window2.bounds[ 3 ] * 2 - navbarheight ];

    I'm sure some one could clarify this, someone who uses jiggy

    Please Register or Log in to view images

  3. e.mann30

    e.mann30 New Member

    Joined:
    Nov 13, 2007
    Messages:
    427
    Likes Received:
    8
    Thank you

    Thanks for your post. I've tried different inputs but came up with the same crap. The whole screen scrolls up and down.

    Anybody with jiggy is willing to answer this thread ? Its not a priority for my app. , but I would like it. Thanks in advance.
  4. PAEz

    PAEz New Member

    Joined:
    Jan 29, 2008
    Messages:
    201
    Likes Received:
    10
    never used this (i do say that alot) but from a quick look you've set the contentSize but did you set the scrollers size and position?
    Im taking it that the contentSize is its virtual size but id guess you still need to set its size on the mainview and its position on it.
    Try...
    mainView2.bounds([window2.bounds[ 0] ,window2.bounds[ 1] +navbarheight,window2.bounds[ 2 ] ,window2.bounds[ 2 ] -navbarheight]);
    ..hope that works for ya, dont have my iTouch to test it on
    also dont forget that most/all? visible controls decend from UIView so all the properties and events that UIView has, so do they and that includes the scroller. So look at its properties for other things to try.

    failing that have a look at jiggy weather, that used a scroller if i remember right...cant think of any others at the mo

Share This Page