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

Animating View when resuming app

$
0
0

Hi guys I m developing ios 7 apps using Titanium 3.2.2 and my question is about resuming apps.

I m trying to animate view when apps open and resuming .but when open the apps its work but when ? resumed its not working. Any idea ?

var box = Ti.UI.createView({
  backgroundColor : 'yellow',
  borderWidth:3,
  borderColor:'#FFBF00',
  height : '140',
  width : '140',
  opacity:0.6,
  borderRadius:70,
  zIndex:120
});
 
function animaten(){
     var matrix = Ti.UI.create2DMatrix();
  matrix = matrix.rotate(180);
  matrix = matrix.scale(3, 3);
  var a = Ti.UI.createAnimation({
    transform : matrix,
    opacity:0,
    duration : 2000,
    autoreverse :false,
    repeat : 50
  });
  box.animate(a);
 
}
win.addEventListener('open',animaten);
 
//Ti.App.addEventListener('resumed',animaten);
Ti.App.addEventListener('resumed',function(){
 
  var matrix = Ti.UI.create2DMatrix();
  matrix = matrix.rotate(180);
  matrix = matrix.scale(3, 3);
  var a = Ti.UI.createAnimation({
    transform : matrix,
    opacity:0,
    duration : 2000,
    autoreverse :false,
    repeat : 50
  });
  box.animate(a);
});

Viewing all articles
Browse latest Browse all 8068

Trending Articles



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