Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15433] iOS7: Nav Bar not appearing in detailed window

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionWon't Fix
Resolution Date2020-02-19T11:44:27.000+0000
Affected Version/sRelease 3.1.3
Fix Version/sn/a
ComponentsiOS
Labelsio7, module, navbar, navbarhidden, window
ReporterConnor Phillips
AssigneeRene Pot
Created2013-10-01T03:19:43.000+0000
Updated2020-02-19T11:44:27.000+0000

Description

I am running on 3.1.3GA and iOS7. I have a window with a tableView set up that upon clicking on a row,a new window is opened with more information about the row they clicked on. This event occurs and I am brought to the detailed window, but my Nav Bar does not appear. I set the top value to 20 like the iOS7 guide says, but this does not help. I noticed if I set the top value to something like 60, the tableView window's nav bar appears. This does not help. Any ideas to why this is happening? Here is my code:
var win = Ti.UI.currentWindow;
win.barColor = '#3d6430';
win.translucent = false;
 
 
 
var data = [],
 
    Detail = require('barDetail');
 
 
var barList = Titanium.UI.createTableView({
    height: Ti.UI.FILL,
    width: Ti.UI.FILL,
    top: 0,
    left: 0
});
win.add(barList);
barList.addEventListener('click', function (e) {
    Ti.API.info('data: ' + JSON.stringify(e.rowData.data));
    var detail = new Detail(e.rowData.data);
    detail.open({modal:false});
});
 
var xhr = Titanium.Network.createHTTPClient();
xhr.onload = function () {
    var json = JSON.parse(this.responseText);
    Ti.API.info(json.length);
    for (var i = 0; i < json.length; i++) {
        var row = Titanium.UI.createTableViewRow({
            className: 'bar-row',
            data: json[i].bar,
            hasChild: true,
            filter: json[i].bar.name
        });
        var titleLabel = Titanium.UI.createLabel({
            text: json[i].bar.name,
            font: {
                fontSize: 14,
                fontWeight: 'bold',
 
            },
            left: 70,
            top: 5,
            height: 20,
            width: 210
        });
        row.add(titleLabel);
 
        data.push(row);
    }
    barList.setData(data);
};
xhr.open('GET', 'http://site.com/data.json');
xhr.send();
 
win.open();
function detail(data) {
    var self = Ti.UI.createWindow({
        backgroundColor:'#e9e7e7',
        title: data.name,
        barColor: '#3d6430',
        navTintColor: '#fff',
        font:{fontFamily: customFont},
        top:20
    });
 
 
 
 
 var ButtonRetour = Ti.UI.createButton({
    title:'Back'
});             
 
ButtonRetour.addEventListener('click', function(){
    self.close();
});
 
self.leftNavButton = ButtonRetour;
 
 
 
 var barData = [];
 
 
 var barImage = Ti.UI.createImageView({
    image:data.logo_url,
    height:95,
    width:149,
    top:5,
    left:6, 
 });
 
 self.add(barImage);
 
 var addressTitleView = Ti.UI.createView({
    backgroundColor:'#3d6430',
    height:20,
    width:155,
    top:5,
    right:0,
 });
 
 self.add(addressTitleView);
 
 var addressTitleLabel = Ti.UI.createLabel({
    text:'ADDRESS',
    color:'#fff',
    font:{size:14, fontFamily: customFont},
    right:5
 });
 
 addressTitleView.add(addressTitleLabel);
 
 var addressView = Ti.UI.createView({
    backgroundColor:'#fff',
    height:70,
    width:150,
    top:30,
    right:5
 });
 
 self.add(addressView);
 
 var addressLabel = Titanium.UI.createLabel({
    text: data.address + "\n" + data.city + ", MD",
    height:Ti.UI.SIZE,
    width:Ti.UI.SIZE,
    font:{size:20, fontWeight: 'bold', fontFamily: customFont},
    top: 10,
    left:5
 });
 
 addressView.add(addressLabel);
 
    return self;
};
 
module.exports = detail;

Attachments

FileDateSize
Screen Shot 2013-09-30 at 1.17.25 PM.png2013-10-01T03:19:43.000+000017730

Comments

  1. Rene Pot 2020-02-19

    Need to use NavigationWindow

JSON Source