widget.newScrollView

I have inserted a newTabBar widget into a ScrollView widget as you can see here http://goo.gl/4sqd4
The ScrollView scrolls horizontally only! as you can see in the code below.

What I want is to let the user be able to scroll the tabBar that is inside a scrollView. A the moment when the user touch the tabBar the focus goes to tabBat only and scrolling will be gone.

As others previously stated the same porblem: I want the scrollView widget working while an item inside it responds to the ‘touch’ event…

Any help will be appreciated.!!

See this screenshot: http://goo.gl/4sqd4

Here is my code:

[code]
local scrollView = widget.newScrollView{
width = 320,
height = 49,
left = 0,
top = 381,
scrollWidth = 1258,
scrollHeight = 49,
hideBackground= true,
maskFile=“images/masknav.png”,
listener = scrollViewListener
}

scrollView.content.verticalScrollDisabled = true
scrollView.content.horizontalScrollDisabled = false
scrollView:scrollToRight( 1, onComplete )

– The innerbar image
local innerbar = display.newImageRect(“images/innerbar.png”, 1258, 49)
innerbar:setReferencePoint(display.TopLeftReferencePoint)
innerbar.x = 0
innerbar.y = 0

local function onBtnPress(event)
local t = event.target.id
if t == “da” then
print("You pressed = "… event.target.id)
elseif t == “pr” then
print("You pressed = "… event.target.id)
elseif t == “ra” then
print("You pressed = "… event.target.id)
elseif t == “st” then
print("You pressed = "… event.target.id)
elseif t == “co” then
print("You pressed = "… event.target.id)
elseif t == “mo” then
print("You pressed = "… event.target.id)
end
end

local tabButtonsDuas = {
{
id=“da”,
label="",
up=“tab2.png”,
down=“tab1_over.png”,
width=29, height=32,
onPress=onBtnPress,
},
{
id=“pr”,
label="",
up=“tab2.png”,
down=“tab3_over.png”,
width=31, height=31,
onPress=onBtnPress
},
{
id=“ra”,
label="",
up=“tab2.png”,
down=“tab2_over.png”,
width=30, height=29,
onPress=onBtnPress,
},
{
id=“st”,
label="",
up=“tab2.png”,
down=“tab2_over.png”,
width=30, height=29,
onPress=onBtnPress,
},
{
id=“co”,
label="",
up=“tab2.png”,
down=“tab2_over.png”,
width=30, height=29,
onPress=onBtnPress,
},
{
id=“mo”,
label="",
up=“tab2.png”,
down=“tab2_over.png”,
width=30, height=29, size=14,
onPress=onBtnPress,
selected = true
},
}

local tabsDuas = widget.newTabBar{
top=0,
left=100,
buttons = tabButtonsDuas,
height = 49,
width = 600,
onPress=onBtnPress,
background=“tabBar.png”
}

scrollView:insert( innerbar )
scrollView:insert( tabsDuas )

group:insert( scrollView )
[/code] [import]uid: 147340 topic_id: 24278 reply_id: 119324[/import]

Hi, I was wondering if its possible to insert native UI in widget.scrollview?
local scroller = widget.newScrollView{

top = 53,
width = 380,
height = 570,
maskFile = “mask.png”,
scrollWidth = 760,
scrollHeight = 500

}

local MyTxt = native.newTextField(50,80, 120, 50)
scroller:insert(MyTxt)
*I tried this code but still the txtfield wont go scrolling either… Can anyone help me on this, especially the Pro’s. Thanks in advance [import]uid: 162389 topic_id: 24278 reply_id: 125244[/import]

Hi, I was wondering if its possible to insert native UI in widget.scrollview?
local scroller = widget.newScrollView{

top = 53,
width = 380,
height = 570,
maskFile = “mask.png”,
scrollWidth = 760,
scrollHeight = 500

}

local MyTxt = native.newTextField(50,80, 120, 50)
scroller:insert(MyTxt)
*I tried this code but still the txtfield wont go scrolling either… Can anyone help me on this, especially the Pro’s. Thanks in advance [import]uid: 162389 topic_id: 24278 reply_id: 125244[/import]

I have a few questions on the ScrollView.

  1. Is there a way to dynamically create mask for scroll views based on the screen size? - for example, iPhone 5 & android tablets/phones has more width available.

Settings : Landscape only app, dynamic scaling with letterbox, horizontal scroll only

  1. top & bottom padding are only for vertical scrolls? how about left/right padding for horizontal scrolls?
    [import]uid: 48484 topic_id: 24278 reply_id: 126914[/import]

I have a few questions on the ScrollView.

  1. Is there a way to dynamically create mask for scroll views based on the screen size? - for example, iPhone 5 & android tablets/phones has more width available.

Settings : Landscape only app, dynamic scaling with letterbox, horizontal scroll only

  1. top & bottom padding are only for vertical scrolls? how about left/right padding for horizontal scrolls?
    [import]uid: 48484 topic_id: 24278 reply_id: 126914[/import]

is it possible to implement a swipeLeft or swipeRight function to the widget.newScrollView in vertical scrollmode only? Like the one you have in newTableView?

or please give us the event.x and event.xStart parameters for the listener? [import]uid: 140000 topic_id: 24278 reply_id: 127088[/import]

is it possible to implement a swipeLeft or swipeRight function to the widget.newScrollView in vertical scrollmode only? Like the one you have in newTableView?

or please give us the event.x and event.xStart parameters for the listener? [import]uid: 140000 topic_id: 24278 reply_id: 127088[/import]

The issue MagnoliaPower described in the 2nd post of this thread has returned in the latest build it seems. Would be great if it could be looked in to asap, thx! :slight_smile:

Edit: After further testing I’ve come to realize it’s when having objects with touch-listeners attached inside the scrollView that do extend outside of the scrollView boundaries that this bug occurs. The buttons still receive the touch even though they are outside of scrollView+mask boundaries. Is there any way to solve this?

Edit 2: Solved. I was using “tap” as event name for the objects, I changed it to “touch” and gave focus to the scrollView on the moved phase. Then I just tracked the event.y of the touch on the object, and checked if it was outside of scrollView bounds, if true then don’t do anything.

Works beautifully :slight_smile: [import]uid: 14018 topic_id: 24278 reply_id: 128870[/import]

The issue MagnoliaPower described in the 2nd post of this thread has returned in the latest build it seems. Would be great if it could be looked in to asap, thx! :slight_smile:

Edit: After further testing I’ve come to realize it’s when having objects with touch-listeners attached inside the scrollView that do extend outside of the scrollView boundaries that this bug occurs. The buttons still receive the touch even though they are outside of scrollView+mask boundaries. Is there any way to solve this?

Edit 2: Solved. I was using “tap” as event name for the objects, I changed it to “touch” and gave focus to the scrollView on the moved phase. Then I just tracked the event.y of the touch on the object, and checked if it was outside of scrollView bounds, if true then don’t do anything.

Works beautifully :slight_smile: [import]uid: 14018 topic_id: 24278 reply_id: 128870[/import]

I also am having the same issue mentioned by Magnolia in the latest build. [import]uid: 13836 topic_id: 24278 reply_id: 131436[/import]

I also am having the same issue mentioned by Magnolia in the latest build. [import]uid: 13836 topic_id: 24278 reply_id: 131436[/import]

for magnolia’s issue try this -> scrollView.isHitTestMasked = true [import]uid: 185094 topic_id: 24278 reply_id: 134598[/import]

for magnolia’s issue try this -> scrollView.isHitTestMasked = true [import]uid: 185094 topic_id: 24278 reply_id: 134598[/import]