【发布时间】:2023-03-03 00:45:01
【问题描述】:
我的标签组中有三个标签。一个选项卡用于更改语言。如果用户更改语言,我需要更改所有选项卡的选定语言。我的标签组代码如下,
<Alloy>
<TabGroup id="myTabGrp"> //Tabgroup Added
<Tab id="one">
<Window class="container">
<Label>This is the Home View</Label>
</Window>
</Tab>
<Tab id="two">
<Window class="container" id="winTwo">
<Label>This is the second View</Label>
</Window>
</Tab>
<Tab id="three">
<Window class="container">
<Button onClick="saveLang">Proceed</Button>
</Window>
</Tab>
</TabGroup>
</Alloy>
所有 ui 文本都从数据库中丢失。那么如何重新加载tab3中继续按钮的时钟选项卡。
我尝试了以下代码,
function saveLang() {
$.myTabGrp.setActiveTab($.two);
}
$.winTwo.addEventListener('focus',function(e) {
// How can I reload the tab2 here....
alert('focus');
});
如果我尝试以下代码,一切正常,但是加载时间太长,它将 struct 3 秒,然后加载所需的输出。我需要避免过长的加载时间。
var homeWindow = Alloy.createController('index').getView();
homeWindow.open({transition:Titanium.UI.iPhone.AnimationStyle.FLIP_FROM_LEFT});
关于我们如何以更少的加载时间重新加载标签的任何建议..
【问题讨论】:
标签: tabs titanium titanium-mobile appcelerator titanium-alloy