Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

How to make a rounded scrollview
Started by arnold.gashi Dec 13 2016 05:29 AM

2 replies to this topic
scrollview
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

arnold.gashi

[GLOBAL: userInfoPane.html]
arnold.gashi
  • Observer

  • 12 posts
  • Corona SDK

I'm making a app that main purpose is the desing and that uses scrollview inside a page. How to make a rounded scrollview?

local widget = require("widget")
local function scrollListener( event )

    local phase = event.phase
    if ( phase == "began" ) then print( "Scroll view was touched" )
    elseif ( phase == "moved" ) then print( "Scroll view was moved" )
    elseif ( phase == "ended" ) then print( "Scroll view was released" )
    end

    -- In the event a scroll limit is reached...
    if ( event.limitReached ) then
        if ( event.direction == "up" ) then print( "Reached bottom limit" )
        elseif ( event.direction == "down" ) then print( "Reached top limit" )
        
        end
    end

    return true
end

    local scrollView = widget.newScrollView(
    {
        top = 600,
        left = 140,
        width = 800,
        height = 900,
        scrollWidth = 800,
        scrollHeight = 1000,
        listener = scrollListener
    }
    )
    image = display.newImageRect( "Untitled.png", 800, 1000 )
    image.anchorX = 0
    image.anchorY = 0
    image.x = 0
    image.y = 0

    scrollView:insert( image )


[TOPIC: post.html]
#2

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,622 posts
  • Corona SDK

I would place the scrollview in a masked group.

[TOPIC: post.html]
#3

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,547 posts
  • Enterprise

Keep in mind, scrollViews are already masked and if you are masking things in the scrollView you could run into a mask depth limit.

 

Rob




[topic_controls]
[/topic_controls]