Hi Everyone,
I am having issues trying to rotate an image 360 degrees. I have tried to google the answer to this and it seems like this might be a bug. Here is the code that I am trying to use to rotate the image. From what I have read there are issues trying to rotate the 2D matrix 360 degrees. I can rotate the image 179 degrees but not sure how to rotate the image the final 180 degrees. I read some where about chaining animations together to get the complete rotation but I am not sure how to do this.
var self = Ti.UI.createView( { width: 'auto', height: 'auto', top: 0 }); var backBtn = Titanium.UI.createImageView({ top:0, left: 10, height: 47, width: 29, anchorPoint: { x: 0.5, y: 0.5 }, image: '/images/spinner.png', canScale: false, }); self.add(backBtn); backBtn.addEventListener('click',function(e) { // Spin the image var t = Ti.UI.create2DMatrix(); var spin = Titanium.UI.createAnimation(); t = t.rotate(179); spin.transform = t; spin.duration = 500; backBtn.animate(spin); })
If anyone has a solution to this it would be greatly appreciated.
I am using the latest SDK and Ti Studio and trying to get this to work on the IOS and Android
Thank you