Scrollview Viewport Mask 不隐藏内容
Scrollview Viewport Mask not hiding content
这是我的场景截图:
我想要一个可以滚动浏览的预制件网格。网格有效,滚动有效,但视口上的遮罩不会隐藏内容。我试过 selecting/deselecting "Show Mask Graphic" 选项,我试过使用 Rect Mask 2D
而不是 和 另外,我试过把面具ScrollView
本身的组件。我有点不知所措。
如果内容不在视口内,我该如何防止其出现?以下是场景对象检查器属性的一些屏幕截图:
ScrollView
:
ViewPort
:
Content
:
游戏对象预制件:
因为那些是 Sprite
,而不是 UI.Image
Unity UI 遮罩对象只能遮罩其他 UI 元素。 Sprite
is not one of those. You should change your prefab to have an UI.Image
component 相反。
这是我的场景截图:
我想要一个可以滚动浏览的预制件网格。网格有效,滚动有效,但视口上的遮罩不会隐藏内容。我试过 selecting/deselecting "Show Mask Graphic" 选项,我试过使用 Rect Mask 2D
而不是 和 另外,我试过把面具ScrollView
本身的组件。我有点不知所措。
如果内容不在视口内,我该如何防止其出现?以下是场景对象检查器属性的一些屏幕截图:
ScrollView
:
ViewPort
:
Content
:
游戏对象预制件:
因为那些是 Sprite
,而不是 UI.Image
Unity UI 遮罩对象只能遮罩其他 UI 元素。 Sprite
is not one of those. You should change your prefab to have an UI.Image
component 相反。