我知道如何在鈦中創建和設置iOS刷新按鈕,但我不知道如何使它們實際刷新標籤頁/窗口中的數據。我爲我的app.js和其他四個選項卡創建了刷新按鈕,但它不刷新數據。在鈦中創建並設置ios刷新按鈕
var Cloud = require('ti.cloud');
var scrollView4 = Ti.UI.createScrollView({
contentWidth: 'auto',
contentHeight: 'auto',
showVerticalScrollIndicator: true,
showHorizontalScrollIndicator: true
});
Titanium.UI.currentWindow.add(scrollView4);
var currentWin4 = Titanium.UI.currentWindow;
var refreshBtn = Titanium.UI.createButton({
Color: 'black',
systemButton : Titanium.UI.iPhone.SystemButton.REFRESH
});
currentWin4.setLeftNavButton(refreshBtn);
currentWin4.add(refreshBtn);
var l1 = Ti.UI.createLabel({
left: 10,
top: 15,
width:'auto',
height:40,
color: '#1E90FF',
text: 'About us',
font: {
fontWeight: 'bold',
fontSize: 20
}
});
scrollView4.add(l1);
var l2 = Ti.UI.createLabel({
left:10,
top: 50,
width:'auto',
height:40,
color: '#336699',
text: 'photo sharing app',
font: {
fontSize: 13
}
});
scrollView4.add(l2);
var l3 = Ti.UI.createLabel({
left: 10,
top: 90,
width:'auto',
height:40,
color: '#336699',
text: '',
font: {
fontSize: 13
}
});
scrollView4.add(l3);
var l5 = Ti.UI.createLabel({
left: 10,
top: 170,
width:'auto',
height:40,
color: '#336699',
text: 'locate us!',
font: {
fontSize: 13
}
});
scrollView4.add(l5);
var l6 = Ti.UI.createLabel({
right: 10,
top: 250,
width:'auto',
height:40,
color: '#1E90FF',
text: 'Development & API',
font: {
fontWeight: 'bold',
fontSize: 20
}
});
scrollView4.add(l6);
var b1 = Ti.UI.createButton({
right: 10,
top: 290,
width:'auto',
height:40,
color: '#336699',
title: 'Development & API',
font: {
fontSize: 13
}
});
scrollView4.add(b1);
var l9 = Ti.UI.createLabel({
center: 0,
top: 460,
width: 'auto',
height: 40,
color: '#1E90FF',
text: 'complaints?'
});
scrollView4.add(l9);
var b2 = Ti.UI.createButton({
center: 0,
top: 500,
width:'auto',
height: 40,
color: '#336699',
title: 'talk to us'
});
scrollView4.add(b2);
var emailDialog = Titanium.UI.createEmailDialog({toRecipients:['[email protected]']});
emailDialog.Subject = ('');
emailDialog.messageBody = '';
b2.addEventListener('click',function(e)
{
emailDialog.open();
});
emailDialog.addEventListener('complete',function(e)
{
if (e.result == emailDialog.SENT)
{
alert("message sent");
}
else
{
alert("message not sent");
}
得到任何代碼?不清楚你在問什麼。 –
感謝您的回覆,我已經用示例代碼編輯了我的問題(選項卡) –
好的...我並不是指代碼轉儲,您是否可以將其修剪到您認爲的問題所在? –