我正在尝试在Appcelerator Titanium中关注有关Android的窗口动画的一些指南,但它们实际上都没有提到轻量级和重量级窗口。
无论如何,最简单的例子不起作用:
// in mainWindow do:
var winInfoView = Ti.UI.createWindow({
title : "info",
url : 'infoview.js',
// notice I don't set the window fullscreen or modal property so that the window remains lightweight
});
winInfoView.open({
animated : true
});
两者都不复杂:
// in mainWindow do:
var winInfoView = Ti.UI.createWindow({
title : "info",
url : 'infoview.js',
// notice I don't set the window fullscreen or modal property so that the window remains lightweight
});
var slideLeft = Ti.UI.createAnimation();
slideLeft.left = 0;
slideLeft.duration = 300;
winInfoView.open(slideLeft);
那么,是否可以为轻量级窗口的开口设置动画?怎么样?
答案 0 :(得分:1)
正如文档http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.Window
所述请确保您已将此代码添加到tiapp.xml中,因为可以在Android平台中使用lightwindow
<property name="ti.android.useLegacyWindow" type="bool">true</property>
这段代码非常适合我:
var menuWindow = Ti.UI.createWindow({
top:0,
left:0,
width:150
});
menuWindow.open({
activityEnterAnimation: Ti.Android.R.anim.slide_in_left
});
menuWindow.add(something);