Thanks for the explaination…
I think you nailed it… I need to swipe on tableview in order to move scenes… but at the same time I need the user to be able to click on a row if he want to see more details about that item… I have this main.lua to do that but it does not work well.
[lua]
local composer = require( “composer” )
local scene = composer.newScene()
local widget = require( “widget” )
local tab_width = 45
local tab_height = 45
local font_size = 8
local Font_Offset = 0
local tabButtons
–local tabBar
local function handleTabBarEvent( event )
print( event.target._id ) --reference to button’s ‘id’ parameter
local effect1
local page =event.target._id
local currScene = composer.getSceneName( “current” )
--local prevScene = composer.getSceneName( “previous” )
print("current screne ",currScene)
if (currScene== “page1”) then
effect1 = “slideLeft”
elseif ((currScene== “page2”) and (page ==“page1”)) then
effect1 = “slideRight”
elseif ((currScene== “page2”) and (page ==“page3”)) then
effect1 = “slideLeft”
elseif (currScene== “page3”) then
effect1 = “slideRight”
end
local options = {
effect = effect1,
time = 1000,
params = {
level = 1,
operation = “x”
}
}
composer.gotoScene( page, options )
--print(tabBar.x)
local dis = tabBar.x - 50
--transition.to( tabBar, {time = 500,x=(dis)} )
end
local title= display.newImageRect(“images/top.png”, 360, 40 )
title.anchorY = 0
title.anchorX = 0
print(" i am in main")
tabButtons = {
{
width = tab_width,
height = tab_height,
label = “الكل”,
id = “page1”,
defaultFile = “icon2.png”,
overFile = “icon2Down.png”,
size=font_size,
labelYOffset = Font_Offset,
onPress = handleTabBarEvent
},
{
width = tab_width,
height = tab_height,
label = “معارض ومؤتمرات”,
id = “page2”,
defaultFile = “icon2.png”,
overFile = “icon2Down.png”,
size=font_size,
labelYOffset = Font_Offset,
selected = true,
onPress = handleTabBarEvent
},
{
width = tab_width,
height = tab_height,
label = “عروض واوبرا”,
id = “page3”,
defaultFile = “icon2.png”,
overFile = “icon2Down.png”,
size=font_size,
labelYOffset = Font_Offset,
onPress = handleTabBarEvent
},
{
width = tab_width,
height = tab_height,
label = “مهرجانات وسياحة”,
id = “page4”,
defaultFile = “icon2.png”,
overFile = “icon2Down.png”,
size=font_size,
labelYOffset = Font_Offset,
onPress = handleTabBarEvent
},
{
width = tab_width,
height = tab_height,
label = “أخرى”,
id = “page5”,
defaultFile = “icon2.png”,
overFile = “icon2Down.png”,
size=font_size,
labelYOffset = Font_Offset,
onPress = handleTabBarEvent
},
}
– Create the widget
_G.tabBar = widget.newTabBar
{
top = 40,
width = display.contentWidth-45,
height=60,
left=20,
backgroundFile = “tabBarBg.png”,
tabSelectedLeftFile = “left.png”,
tabSelectedRightFile = “middle.png”,
tabSelectedMiddleFile = “right.png”,
tabSelectedFrameWidth = 20, – New
tabSelectedFrameHeight = 50,
buttons = tabButtons
}
_G.tabBar:setSelected(1,true)
[/lua]
do you have samples or tips to achieve it.
Regards
Abdulaziz