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

Can't move label in Android

$
0
0

Based on some question found on this site I've made this simple autoscrolling label.

self.title = Ti.UI.createLabel({
    text : namtitle,
    color : main.theme.color.distbg,
    top : 0,
    left : Util.getDimension(20),
    height : Util.getDimension(58),
    font : {
        fontFamily : main.theme.font.regular,
        fontSize : Util.getDimension(58)
    },
});
 
var title_width = self.title.toImage().width;
self.title.width = title_width;
 
var scrollLabelAnimation = Titanium.UI.createAnimation({
    left : -Util.getDimension(title_width),
    duration: 10000,
    curve : Titanium.UI.ANIMATION_CURVE_LINEAR  
});
 
scrollLabelAnimation.addEventListener('complete',function(){
    self.title.left = Util.getDimension(20);
    self.title.animate(scrollLabelAnimation);
});
 
self.title.animate(scrollLabelAnimation);
On IPad it's working fine, in Android it does the first animation and then it blocks. The event is fired and the animation recalled(I put a log inside and i can see that is working as expected), it seems that the following instruction has no effect:
self.title.left = Util.getDimension(20);
This is the instruction that reset label position.

Util.getDimenstion is a simple function to adjust size for different resolution.

Any ideas why isn't working on Android?


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>