Advertisement
lavalevel

A ScrollView Widget 2.0

Oct 22nd, 2013
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 KB | None | 0 0
  1.  
  2. local Days = math.random (1,5) 
  3. local widget = require( "widget" )
  4. local scrollContentsGroup - display.newGroup()
  5.  
  6. scrollView = widget.newScrollView
  7.     {
  8.         left = 10,
  9.         top = 10,
  10.         width = 300,
  11.         height = 300,
  12.         bottomPadding = 120,
  13.         topPadding = 0,
  14.         id = "onBottom",
  15.         hideBackground = false,
  16.         backgroundColor = { 0, 0, 0, 64},
  17.         horizontalScrollDisabled = true,
  18.         verticalScrollDisabled = false,
  19.         listener = scrollListener,
  20.         --isBouncedEnabled = false,
  21.     }
  22.  
  23.     end
  24.  
  25.     --Create a text object for the scrollViews title
  26.     local txt_days = display.newText(  "Days "  .. Days  , 0, 0, native.systemFont, 40)
  27.     txt_days:setTextColor(225, 225, 225)
  28.     txt_days.x = display.contentCenterX
  29.     txt_days.y = 30
  30.    
  31.     scrollContentsGroup:insert( txt_days )
  32.  
  33.     place_content = place_content + (txt_days.y + txt_days.height )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement