Image Scroller work in IOS but not in Android
Posted: Wed Oct 23, 2013 8:47 pm
HI,this is a photo album that is need horizontal image scroller. However, I find some code that is work in IOS but not work in Android.
This is work in IOS ↓
Then, I change to ↓ for Android but not work.
Is there wrong in this code? Is there a good way to find out other code to replace? Or have another horizontal image scroller code is work in IOS and Android ?
I'm a bit under pressure here to get this Android version wrapped asap so I'd really appreciate any help. Thanks!
This is work in IOS ↓
Code: Select all
on preOpenCard
if the environment is "mobile" then
createScroller
end if
end preOpenCard
on createScroller
clearScroller "cardsScroller"
set the unboundedHScroll of group "cards" to true
iphoneControlCreate "scroller", "cardsScroller"
iphoneControlSet "cardsScroller", "rect", "0,0,320,402"
iphoneControlSet "cardsScroller", "contentRect", "0,0,1600,402"
iphoneControlSet "cardsScroller", "visible", "true"
iphoneControlSet "cardsScroller", "scrollingEnabled", "true"
iphoneControlSet "cardsScroller", "pagingEnabled", "true"
iphoneControlSet "cardsScroller", "canBounce", "true"
iphoneControlSet "cardsScroller", "decelerationRate", "fast"
iphoneControlSet "cardsScroller", "canCancelTouches", "true"
iphoneControlSet "cardsScroller", "delayTouches", "true"
iphoneControlSet "cardsScroller", "vIndicator", "false"
iphoneControlSet "cardsScroller", "hIndicator", "false"
iphoneControlSet "cardsScroller", "indicatorStyle", "black"
iphoneControlSet "cardsScroller", "indicatorInsets", "0,0,0,0"
iphoneControlSet "cardsScroller", "hscroll", 0
iphoneControlSet "cardsScroller", "vscroll", 0
end createScroller
on scrollerDidScroll pX, pY
if iPhoneControlTarget() is "cardsScroller" then
set the hScroll of group "cards" to pX
end if
end scrollerDidScroll
on clearScroller pScrollerName
if pScrollerName is among the lines of iphoneControls() then
iphoneControlDelete pScrollerName
end if
end clearScroller
Code: Select all
on preOpenCard
if the environment is "mobile" then
createScroller
end if
end preOpenCard
on createScroller
clearScroller "cardsScroller"
set the unboundedHScroll of group "cards" to true
mobileControlCreate "scroller", "cardsScroller"
mobileControlSet "cardsScroller", "rect", "0,0,320,402"
mobileControlSet "cardsScroller", "contentRect", "0,0,1600,402"
mobileControlSet "cardsScroller", "visible", "true"
mobileControlSet "cardsScroller", "scrollingEnabled", "true"
mobileControlSet "cardsScroller", "pagingEnabled", "true"
mobileControlSet "cardsScroller", "canBounce", "true"
mobileControlSet "cardsScroller", "decelerationRate", "fast"
mobileControlSet "cardsScroller", "canCancelTouches", "true"
mobileControlSet "cardsScroller", "delayTouches", "true"
mobileControlSet "cardsScroller", "vIndicator", "false"
mobileControlSet "cardsScroller", "hIndicator", "false"
mobileControlSet "cardsScroller", "indicatorStyle", "black"
mobileControlSet "cardsScroller", "indicatorInsets", "0,0,0,0"
mobileControlSet "cardsScroller", "hscroll", 0
mobileControlSet "cardsScroller", "vscroll", 0
end createScroller
on scrollerDidScroll pX, pY
if mobileControlTarget() is "cardsScroller" then
set the hScroll of group "cards" to pX
end if
end scrollerDidScroll
on clearScroller pScrollerName
if pScrollerName is among the lines of mobileControls() then
mobileControlDelete pScrollerName
end if
end clearScroller
I'm a bit under pressure here to get this Android version wrapped asap so I'd really appreciate any help. Thanks!