问题
On my mobile app, the SC.ScrollView appears to function properly in that it begins to scroll downward, however after I release my finger, instead of continuing to scroll down, it bounces back to it's original position.
It works perfectly when I run everything through sc-server
, but once I push it to production using sc-build
, it messes up.
What could be causing this?
回答1:
Turns out, one of my stylesheets had done something stupid and manually set the height of the body to be 10,000px
which apparently messes up the scrollbars. They expect the body's dimensions to be exactly the same size as the screen.
I changed my css to the following and it works:
body {
position: absolute;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
}
来源:https://stackoverflow.com/questions/16718020/why-does-sc-scrollview-bounce-on-touch-instead-of-scroll