scrollView inconsistent between IOS and Android

Anyone else having a problem with scrollView? When I build my application containing a scrollView with varying text length to display, it works perfectly in IOS, but when I build for Android and test on an Android device it doesn’t work properly. If the inserted text object is less than or 2 times the scrollView.height it works as desired, however once the text object height is approximately greater than 2 times the scrollView.height it doesn’t work properly. In this case, if I scroll UP it will scroll off the “screen” regardless of whatever bottom padding value I use.

Any ideas out there?

Here is the code I’m using if that helps.

[lua] 

local stringVar = “Some amount of text from 5 to 200 lines”

local textToViewObject = display.newText(sceneGroup,stringVar,0,0,300,0,“Helvetica”,16)

local scrollView = widget.newScrollView

  { left = 0,

    top = 0,

    width = display.contentWidth,

    height = display.contentHeight / 2,

    scrollWidth = display.contentWidth, 

    topPadding = 10, 

    bottomPadding = 25,

    horizontalScrollDisabled=true,

    verticalScrollDisabled=false,

    backgroundColor = { 1,1,1 },

  }

  sceneGroup:insert(scrollView)

  scrollView.anchorX=0; scrollView.x = 5;

  scrollView.anchorY=0; 

  scrollView.y = display.contentWidth/2,  – positions under animation on top half of display

  textToViewObject:setFillColor(0,0,0) --black text

  textToViewObject.x, textToViewObject.y = display.contentCenterX, textToViewObject.height/2

  scrollView:insert(textToViewObject)

[/lua]

What does your config.lua life look like?

My config.lua looks like this.

[lua] 

application =

{

     license =

    {

        google =

        {

           key = “myGoogleKey”,

        },

    },

content =

{

width = 320,

height = 480,

scale = “zoomStretch”,

imageSuffix =

{

["@1-5"] = 1.5, – for Droid, Nexus One, etc.

["@2x"] = 2, – for iPhone, iPod touch, iPad1, and iPad2

["@3x"] = 3, – for various mid-size Android tablets

["@4x"] = 4, – for iPad 3

}

},

}

[/lua]

What do you mean by “It doesn’t work properly”? A screen shot or video would be helpful.

Rob

This is what use for apps with scroll view. Give it a go. 

local aspectRatio = display.pixelHeight / display.pixelWidth application = { content = { width = aspectRatio \> 1.5 and 320 or math.floor( 480 / aspectRatio ), height = aspectRatio \< 1.5 and 480 or math.floor( 320 \* aspectRatio ), scale = "letterBox", fps = 30, --[[imageSuffix = { ["@2x"] = 2, }, --]] }, --[[-- Push notifications notification = { iphone = { types = { "badge", "sound", "alert", "newsstand" } } }, --]] }

Thanks for replying Rob and InfiSnyp. I’m vacationing in Italy right now and will try InfiSnyp’s suggestion next week when I return home. Rob, I’ll also try to send you a video of how it is behaving. Thanks again, Guy

What does your config.lua life look like?

My config.lua looks like this.

[lua] 

application =

{

     license =

    {

        google =

        {

           key = “myGoogleKey”,

        },

    },

content =

{

width = 320,

height = 480,

scale = “zoomStretch”,

imageSuffix =

{

["@1-5"] = 1.5, – for Droid, Nexus One, etc.

["@2x"] = 2, – for iPhone, iPod touch, iPad1, and iPad2

["@3x"] = 3, – for various mid-size Android tablets

["@4x"] = 4, – for iPad 3

}

},

}

[/lua]

What do you mean by “It doesn’t work properly”? A screen shot or video would be helpful.

Rob

This is what use for apps with scroll view. Give it a go. 

local aspectRatio = display.pixelHeight / display.pixelWidth application = { content = { width = aspectRatio \> 1.5 and 320 or math.floor( 480 / aspectRatio ), height = aspectRatio \< 1.5 and 480 or math.floor( 320 \* aspectRatio ), scale = "letterBox", fps = 30, --[[imageSuffix = { ["@2x"] = 2, }, --]] }, --[[-- Push notifications notification = { iphone = { types = { "badge", "sound", "alert", "newsstand" } } }, --]] }

Thanks for replying Rob and InfiSnyp. I’m vacationing in Italy right now and will try InfiSnyp’s suggestion next week when I return home. Rob, I’ll also try to send you a video of how it is behaving. Thanks again, Guy