Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Slide a view has some problem on Android

$
0
0

Hi there!

I try to create a very basic application:

It has a window with a view, and if you tap on an image, an another view should slide in front of the first view... Unfortunately, on Android it has a strange error: Only the visible part of the second view shown while the animate function is in progress... When it's done, it draws the whole moved view... Please check this Youtube link for video demonstration: http://youtu.be/uL90JU6OzvU

I tested on iPhone, it works like a charm...

Here is my code:

var winRoot = Ti.UI.createWindow({
        fullscreen: true,
        navBarHidden: true,
        preload: true
    });
 
    var viewMain = Ti.UI.createView({
      backgroundColor: "#FFFF00",
    });
 
    var win1NextPageBtn = Ti.UI.createImageView({
        image : '/images/korbenyil_left.png',
        width:"40 dip",
        height:"150 dip",
        right: "0 dip",
    }); 
 
    viewMain.add(win1NextPageBtn); 
 
    var viewPreview = Ti.UI.createView({
      backgroundColor:'#FF00FF',
      left: Titanium.Platform.displayCaps.platformWidth - 10,
    });
    var backToMainBtn = Ti.UI.createImageView({
        image : '/images/korbenyil_left.png',
        width:"40 dip",
        height:"150 dip",
        left: "10 dip",
    });
    viewPreview.add(backToMainBtn);
 
    winRoot.add(viewMain);
    winRoot.add(viewPreview);
    winRoot.open();
 
    win1NextPageBtn.addEventListener('click', function() {          
        setTimeout(function(e){ viewPreview.animate({left:0,duration:2000});}, 150);
    });
 
    backToMainBtn.addEventListener('click', function() {
        setTimeout(function(e){ viewPreview.animate({left:Titanium.Platform.displayCaps.platformWidth - 10,duration:2000});}, 150);
    });

Viewing all articles
Browse latest Browse all 8068

Trending Articles