0

I followed the answer here

How to Swipe between surfaces in Famo.us?

var Engine           = require("famous/core/Engine");
var Surface          = require("famous/core/Surface");
var Scrollview       = require("famous/views/Scrollview");

var mainContext = Engine.createContext();

var scrollview = new Scrollview({
    direction: 0,
    paginated: true
});
var surfaces = [];

scrollview.sequenceFrom(surfaces);

for (var i = 0; i < 10; i++) {
    surface = new Surface({
        content: "Surface: " + (i + 1),
        size: [window.innerWidth, window.innerHeight],
        properties: {
            backgroundColor: "hsl(" + (i * 360 / 10) + ", 100%, 50%)",
            lineHeight: window.innerHeight/10 + "px",
            textAlign: "center"
        }
    });

    surface.pipe(scrollview);

    surfaces.push(surface);
}

mainContext.add(scrollview);

I tested this on real iOS 7 in iPhone 5.

Problem:

  1. Swipe right. For example: moving from Surface 5 to Surface 4

  2. Touch the screen

  3. It suddenly moved back to Surface 5

I am not sure why (whether bug in platform). Is there a way to fix this?

Community
  • 1
  • 1
HP.
  • 19,226
  • 53
  • 154
  • 253
  • I tested this code, and I see what you are talking about.. That example is as vanilla as possible, and the other pagination options do not seem to solve the problem. It is clearly a bug. I'll look into finding a work around. – johntraver May 15 '14 at 22:35
  • Funny thing is when I reduced to 2 surfaces only. It worked just fine. No "touch" causing "swipe" bug. – HP. May 15 '14 at 23:00

0 Answers0