我需要在我的项目的视图之间做一个淡入淡出动画。这是制作动画和创建视图/窗口的最佳方式,哪一种是最好的。建议我解决这个问题?我在测试环境中使用 Titanium 3.1.2.GA、Alloys 和 Android Emulator。任何例子都可以appriciated?我在appcelerator论坛中的帖子
索引.xml
<Alloy>
<Window id="fblogin" class="container">
<Require src="loginsuccess" id="loginsuccess"></Require>
<Require src="loginFailure" id="loginFailure"></Require>
<Require src="loginPage" id="loginPage"></Require>
</Window>
</Alloy>
登录页面.xml
<Alloy>
<View class="container">
<LoginButton ns="Alloy.Globals.Facebook"/>
<Button title="Google"></Button>
</View>
</Alloy>
登录失败.xml
<Alloy>
<View class="container">
<Label>Login Failed. Please try again later.</Label>
</View>>
</Alloy>
登录成功.xml
<Alloy>
<View class="container">
<Label>Login Successful</Label>
</View>
</Alloy>
index.js
var animation = require('alloy/animation');
var loginPage = $.loginPage;
var loginsuccess = $.loginsuccess;
var loginFailure = $.loginFailure;
function loginFails(){
animation.crossFade(loginPage, loginFailure, 500, function(){});
}
function loginSuccess(){
animation.crossFade(loginPage, loginsuccess, 500, function(){});
}
$.fblogin.open();