在scrollView 的 onScrollEnd onScrollMove事件中 通过一以代码就能知道,scrollView 纵向滚动了多少位置,顶部从0开始,越向下 越是 负向增长
event.source.scroller.y
//随之高度的改变动态修改titleBar的值!
Model.prototype.demoListScrollMove = function(event){
var height = -event.source.scroller.y;
this.getElementByXid('titleBar1').style.backgroundColor=
"rgb(0,0,"+Math.round(height/10)+")";
};
评一波