Iphone 添加的导航按钮没有';t首次在钛合金中工作
我在导航中添加了导航按钮,并在其上编写了“单击”功能,但它第一次不起作用。事实上,我在第一次点击时在导航栏上添加了一个按钮,第二次点击时它不起作用。我该如何解决这个问题 我的xml代码是Iphone 添加的导航按钮没有';t首次在钛合金中工作,iphone,navigation,titanium-mobile,titanium-alloy,Iphone,Navigation,Titanium Mobile,Titanium Alloy,我在导航中添加了导航按钮,并在其上编写了“单击”功能,但它第一次不起作用。事实上,我在第一次点击时在导航栏上添加了一个按钮,第二次点击时它不起作用。我该如何解决这个问题 我的xml代码是 <Alloy> <Window id="aboutWin" name="aboutWinName"> <NavigationGroup id="navAbout" platform="ios"> <Window class="container
<Alloy>
<Window id="aboutWin" name="aboutWinName">
<NavigationGroup id="navAbout" platform="ios">
<Window class="container" id="aboutChildWin">
<View id="aboutView">
<ImageView id="logoImg"></ImageView>
<ImageView id='logoWrd'></ImageView>
<Label id="versionLbl"></Label>
</View>
<View id="footView"></View>
</Window>
</NavigationGroup>
</Window>
</Alloy>
})
有谁能解决这个听起来很愚蠢的问题,但是你试着改变顺序了吗?
如果不使用alloy,此更改不会产生任何影响。我只做了一个小更改,在导航窗口中插入添加按钮,我将导航按钮添加到整个窗口中 代码是:
$.aboutWin.leftNavButton = button;
var button = Titanium.UI.createButton({
// title:"Back",
backgroundImage:"/images/MenuList.png",
// top : 4.5,
height : 35,
width : 40,
// left : 4
});
button.addEventListener('click',function(){
if(Ti.App.currentAnimateWindow == "About")
{
Ti.App.socialWindow.hide();
Ti.App.menuWindow.show();
$.aboutWin.animate(animateLeft);
Ti.App.currentAnimateWindow = "Menu";
}
else if(Ti.App.currentAnimateWindow == "Menu")
{
$.aboutWin.animate(animateRight);
Ti.App.currentAnimateWindow = "About";
}
};
$.aboutChildWin.leftNavButton = button;
$.aboutWin.leftNavButton = button;