2012年1月10日火曜日

TitaniumでアニメーションGIFは使えない?

自前でアニメーションさせる方法が載っているが・・・


var win = Ti.UI.createWindow();
 
// create an imageview and set it to the width and height of your images
var loaderImage = Ti.UI.createImageView({
  width:54,
  height:54
});
 
// add it to your window
win.add(loaderImage);
 
// set the length of the images you have in your sequence
var loaderArrayLength=12;
 
// initialize the index to 1
var loaderIndex=1;
 
// this function will be called by the setInterval
function loadingAnimation(){
  // set the image property of the imageview by constructing the path with the loaderIndex variable
  loaderImage.image = "images/loader-sequence/frame" + loaderIndex + ".png";
  //increment the index so that next time it loads the next image in the sequence
  loaderIndex++;
  // if you have reached the end of the sequence, reset it to 1
  if(loaderIndex===13)loaderIndex=1;
}
 
// start the setInverval -- adjust the time to make a smooth animation
var loaderAnimate = setInterval(loadingAnimation,80);
 
 
win.open();

http://developer.appcelerator.com/question/68971/does-imageview-support-gif-file

0 件のコメント:

コメントを投稿