Skip to content

Instantly share code, notes, and snippets.

@rakhimoni
Last active November 21, 2017 10:57
Show Gist options
  • Save rakhimoni/ae63148f75c1aaf1dca852e44aaf7c1d to your computer and use it in GitHub Desktop.
Save rakhimoni/ae63148f75c1aaf1dca852e44aaf7c1d to your computer and use it in GitHub Desktop.
Titanium view usning Animation
/**
Issue Description: Ti.UI.createView returns a View without an animate function on iOS.
This is causing some abrupt UI changes to the user, but more worryingly is throwing a script error in the background,
which will eventually result in a crash.
**/
/////////////////////////////////
I have tested the issue and unable to reproduce the issue using SDK 6.3.0.GA with the sample code provided below.
Test Environment:
Appcelerator Command-Line Interface, version 6.3.0
Mac OS X 10.13.1
Architecture 64bit
CPUs 4
Memory 8589934592
Axway Appcelerator Studio, build: 4.10.0.201709271713
Appcelerator Command-Line Interface, version 6.2.4,
SDK Version = SDK 6.3.0.GA
Node.js Version = 4.7.0
npm Version = 2.15.11
Android Device: HUAWEI GR3 2017
Test Steps:
1. Open Studio and create a classic project
2. Run the project.
3. After running the project a red view will display first, then we will see black and green one after another using animation
Test Code:
var win = Titanium.UI.createWindow({
backgroundColor: 'pink',
title: 'Red Window'
});
var view = Titanium.UI.createView({
backgroundColor:'red',
width:300,
height:300
});
var animation = Titanium.UI.createAnimation();
animation.backgroundColor = 'black';
animation.duration = 3000;
var animationHandler = function() {
animation.removeEventListener('complete',animationHandler);
animation.backgroundColor = 'Green';
view.animate(animation);
};
animation.addEventListener('complete',animationHandler);
view.animate(animation);
win.add(view);
win.open();
Output:https://s2.postimg.org/kv2603ovd/Screenshot_20171121-162024.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment