[Resolved] scrollview height/mask problem

I want to set my newscrollview to a specific height

there are two ways to do that

1 - either by setting the height property,
or
2 - by using masks

the problem is when you change the ScollView size it changes only the look of the scrollview and it will not prevent the hidden area from being touch enabled? is this a bug?

here is the code

local widget = require "widget"  
  
local myscrollview = widget.newScrollView{  
 height = 300,  
 maskFile="mask.png"  
}  
  
local obj1 = display.newRect(0, 0, display.contentWidth, display.contentHeight)  
obj1:setReferencePoint( display.TopLeftReferencePoint )   
obj1:setFillColor(255,27,27)  
obj1.x = 0  
obj1.y = 0  
  
local obj2 = display.newRect(0, 0, display.contentWidth, display.contentHeight)  
obj2:setReferencePoint( display.TopLeftReferencePoint )   
obj2:setFillColor(0,27,27)  
obj2.x = 0  
obj2.y = 260  
myscrollview:insert(obj1)  
myscrollview:insert(obj2)  

is there any way to prevent the masked area from being touched??? I believe this is the normal behavior and it should work like this?

Thanks in Advance
[import]uid: 8519 topic_id: 26549 reply_id: 326549[/import]

Any help from the staff or corona experts will help a lot? [import]uid: 8519 topic_id: 26549 reply_id: 107776[/import]

I think I have figured it out :slight_smile:

you have to add this line of code

 myscrollview.isHitTestMasked = true  

see if you want the Documentation of isHitTestMasked
http://developer.anscamobile.com/node/10370
Thanks to anyone tried to solve :slight_smile: [import]uid: 8519 topic_id: 26549 reply_id: 108259[/import]

Hey, thanks for updating this with your solution :slight_smile:

Just for future reference I’d suggest trying to post widget related threads in the new widget sub forum; it should help you get faster answers :wink:

Peach [import]uid: 52491 topic_id: 26549 reply_id: 108291[/import]

@oooobs

Thanks for that solution, I had the same issue.

Nail [import]uid: 106779 topic_id: 26549 reply_id: 108320[/import]