Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Labels overlapping each other in custom row

$
0
0

hi,

so i am working with alloy and i have succesfully pulled data from json and show it succesfully in my console

the idea is to put this data into a tableView. Here is the code:

˜˜˜

function showData(e){ //FB userID
var urlFBid = Alloy.Globals.userID; Ti.API.info(urlFBid);

//accesToken
var accTo = Titanium.Facebook.getAccessToken();
Ti.API.info(accTo);

var dataTableFood = [];

var url = 'XXXXXXXXXXXXX';
var xhr = Ti.Network.createHTTPClient({
    onload : function(e) {
        var jsonObject = JSON.parse(this.responseText);

        for (var i = 0; i < jsonObject.statuses.length; i++) {
            Ti.API.info('response :' + i);
            Ti.API.info('message: ' + jsonObject.statuses[i].message);
            Ti.API.info('fbname: ' + jsonObject.statuses[i].fbname);
            Ti.API.info('distance: ' + jsonObject.statuses[i].distance);
            Ti.API.info('-----------------------------');

            var row = Ti.UI.createTableViewRow({
                //className: 'feeds-food',
                backgroundColor:"#4ca6dd",
                layout: 'vertical',
                height: 'auto',
            })
            $.foodPageScreen.add(row);

            var titleLable = Ti.UI.createLabel({
                text: "Posted By " + jsonObject.statuses[i].fbname,
                left:25,
                top:55,

            })
            $.foodPageScreen.add(titleLable);

            //adding the data to the row
            dataTableFood.push(row);
            //adding the data to the tableView
            $.tblFeedFood.data = dataTableFood;

        }
    },
    onerror : function(e) {
         Ti.API.debug(e.error);
        alert('error');
    },
    timeout : 5000 
});
xhr.open("GET", url);
//sending data to the server
var data = {
    userAccesToken: $.accTo,
    longitutde: $.longitude,
    latitude: $.latitude,
    category: 1,
    userFBId: Ti.Facebook.uid
};
xhr.send();

}

˜˜˜

The problem is that the labels are overlapping each other, so they are not showing in the respective rows

Anybody know what i am doing wrong.....


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>