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]