我想在点击相应的按钮时动画视图,不幸的是当动画从上到下的视图闪烁:
/*
* ANIMATE FROM BOTTOM TO TOP
*/
function showModal(item){
var bottom_to_top = Ti.UI.createAnimation({
top : '0%',
duration : 500
});
$[item].animate(bottom_to_top)
}
/*
* ANIMATE FROM TOP TO BOTTOM
*/
function hideModal(item){
var top_to_bottom = Ti.UI.createAnimation({
top : '100%',
duration : 500
});
$[item].animate(top_to_bottom)
}
///// HERE I SHOW HIDE MY VIEW
function button_show(){
showModal($.myView);
}
function button_hide(){
hideModal($.myView);
}
第一个问题,如果我分配"100%"来隐藏视图,当我试图显示时,它不会出现,只有值99及以下的作品。第二个问题,隐藏视图时动画闪烁。
谁能告诉我该怎么做?谢谢你。尽量避免使用百分比边距。此外,使用本地技术来显示模态窗口,例如
var window = Ti.UI.createWindow({
title: "My Modal Window",
backgroundColor: "white"
});
var nav = Ti.UI.iOS.createNavigationWindow({
window: window
});
nav.open({
modal: true
});