0

我从基本的选项卡模型开始,使用 KitchenSink 开始改变,“定制”它以满足我的需要。我创建了 3 个表视图,每个表视图都打开了自己的垂直布局和表视图行。出于某种原因,我没有读过的东西。我无法将任何内容附加到第一个选项卡。帮助将不胜感激。

我还包含了 JS 文件的一部分

应用程序.js

(function() {
//determine platform and form factor and render approproate components
var osname = Ti.Platform.osname,
    version = Ti.Platform.version,
    height = Ti.Platform.displayCaps.platformHeight,
    width = Ti.Platform.displayCaps.platformWidth;

//considering tablet to have one dimension over 900px - this is imperfect, so you   should feel free to decide
//yourself what you consider a tablet form factor for android
var isTablet = osname === 'ipad' || (osname === 'android' && (width > 899 ||    height > 899));

var Window;
if (isTablet) {
    Window = require('ui/tablet/ApplicationWindow');
}
else {
    Window = require('ui/handheld/ApplicationWindow');
}

var ApplicationTabGroup = require('ui/common/ApplicationTabGroup');
new ApplicationTabGroup(Window).open();

})();

应用程序选项卡组。

function ApplicationTabGroup(Window) {
//create module instance
var self = Ti.UI.createTabGroup();

//create app tabs
var win1 = new Window(('Core Measures')),
    win2 = new Window(('Patient'));
    win3 = new Window(('Provider'));

var tab1 = Ti.UI.createTab({
    title: ('Core Measures'),
    window: win1
});
win1.containingTab = tab1;

var tab2 = Ti.UI.createTab({
    title: ('Patient'),
    window: win2
});
win2.containingTab = tab2;

var tab3 = Ti.UI.createTab({
    title: ('Provider'),
    window: win3
});
win3.containingTab = tab3;

self.addTab(tab1);
self.addTab(tab2);
self.addTab(tab3);

return self;

};

module.exports = ApplicationTabGroup;

表视图

function CoreMeasures(title) {
var self = Ti.UI.createWindow({
    title:.title,
    backgroundColor:'white'
});
//create table view data object
var data = [
   {title: 'Pneumonia', hasChild : true, test: 'ui/common/pneumonia'},
   {title: 'CHF', hasChild: true, test:ui/common/CHF'},
   {title: 'Myocardial Infarction', hasChild: true, test: 'ui/common/Myocardial Infarction'};
]




// create table view
for (var i = 0; i < data.length; i++ ) { 
var d = data[i];
if(d.touchEnabled !==false) {
    d.color = '#000'
    data:data
});

// create table view event listener
tableview.addEventListener('click', function(e)
{
   if (e.rowData.test)
    {
        var ExampleWindow = require(e.rowData.test),
            win = new ExampleWindow({title:e.rowData.title,containingTab:self.containingTab,tabGroup:self.tabGroup});
        if (Ti.Platform.name == "android") {

        } else {
            win.backgroundColor = "#fff"
4

1 回答 1

0

有几件事。我在任何地方都没有看到您调用了 CoreMeasures 函数。此外,您可能对以下代码有疑问:

function CoreMeasures(title) {
var self = Ti.UI.createWindow({
    title:.title,
    backgroundColor:'white'
});

我注意到你的标题前有一个点。

于 2013-04-29T01:30:16.603 回答