一定要按照這個方式來佈局
背景就是顯示內容的地方,遮罩一定別忘記了,這個是很重要的,就是指顯示你要顯示的區域,其他的區域不顯示,滾動的區域就是你要顯示的內容
給ruleLabelBg添加ScrollView屬性
給遮罩添加遮罩屬性
content的區域大小設置和遮罩一樣的大小
代碼部分:
properties: {
scrollView: {
default: null,
type: cc.ScrollView
},
ruleTip: {
default: null,
type: cc.Node
}
// scrollView: cc.ScrollView
},
// LIFE-CYCLE CALLBACKS:
onLoad() {
this.scrollView.content.height = 1470;
},
這樣就搞定了