Hi Everyone,
I have an issue where setTransform(Ti.UI.create2DMatrix().rotate(x)); works as expected on IOS and does not work on Android. When you click the button it rotates by 10 degrees on each click fine on iPhone and on Android nothing happens. One thing I found was that the rotate works on Android once if you set the rotate before adding it to the screen.
If anyone can see if I am making a dumb mistake or if this is a bug with the SDK please let me know. I have seached the Q/A and documentation for any clues but could not find anything that helped.
Here is the sample code. I created this in a Classic project to make is simple for anyone to test. I also first tried this in alloy project but got the sample results.
var rootwindow = Ti.UI.createWindow({ backgroundColor: 'white' }); var x = 0; var button = Titanium.UI.createButton({ title: 'Rotate Red Bar', top: 50, width: Ti.UI.SIZE, height: 50, backgroundColor: 'blue', color: 'white' }); button.addEventListener('click',function(e) { Ti.API.info('============ Rotate View --------' + x); x += 10; viewToRotate.setTransform(Ti.UI.create2DMatrix().rotate(x)); }); var viewToRotate = Titanium.UI.createView({ top: 200, width: 300, height: 50, backgroundColor: 'red', }); rootwindow.add(viewToRotate); rootwindow.add(button); rootwindow.open();Current environment: Host OS: Mac OS X OS Version: 10.9.2 Titanium Studio Version: 3.2.3.201404181442 Titanium SDK Version: 3.2.3.GA XCode Version: 5.1.1 Android SDK Version: 4.4.2 iOS simulator, Android emulator
Thanks in advance
Sean