appcelerator 모바일 앱에서 Town 's API의 Bands 이벤트를 구문 분석하고 표시하는 데 문제가 있습니다. (iOS) 이것은 테이블에 보여주고 싶은 밴드 이벤트입니다. http://api.bandsintown.com/artists/Lucy%20Seven/events.json?api_version=2.0&app_id=LucySeven 그리고 이것은 내가 보여주는이 코드를입니다 그것을bandsintown API에서 json을 파싱합니다.
여기 JSON에 대한 API 응답이var win = Ti.UI.currentWindow;
win.hideNavBar();
Ti.UI.backgroundColor = '#050505';
var url = "http://api.bandsintown.com/artists/Lucy%20Seven/events.json? api_version=2.0&app_id=LucySeven"
var table = Ti.UI.createTableView({
backgroundColor: '#050505',
separatorColor:'#110000',
});
var tableData = [];
var json, artists, name, picture, title, description;
var xhr = Ti.Network.createHTTPClient({
onload: function() {
// Ti.API.debug(this.responseText);
json = JSON.parse(this.responseText);
for (i = 0; i < json.data.length; i++) {
data = json.data[i];
row = Ti.UI.createTableViewRow({
height:'100dp',
backgroundColor: '#050505',
separatorColor:'#110000',
});
var name = Ti.UI.createLabel({
text: title,
font:{
fontSize:'17dp',
fontWeight:'bold'
},
height:'auto',
left:'90dp',
top:'20dp',
color:'#eee',
touchEnabled:true
});
row.add(name);
var start = Ti.UI.createLabel({
text: description,
font:{
fontSize:'12dp'
},
height:'auto',
left:'90dp',
bottom:'20dp',
color:'#eee',
touchEnabled:true
});
row.add(start);
// Avatar
var img = Ti.UI.createImageView({
image : thumb_url ,
width : 70,
height : 70,
top : 5,
bottom : 5,
borderRadius: 5,
borderColor: '#eee',
left : 5
});
row.add(img);
tableData.push(row);
}
table.setData(tableData);
},
onerror: function(e) {
Ti.API.debug("STATUS: " + this.status);
Ti.API.debug("TEXT: " + this.responseText);
Ti.API.debug("ERROR: " + e.error);
alert('There was an error retrieving the remote data. Try again.');
},
timeout:5000
});
xhr.open("GET", url);
xhr.send();
: 정말 캔트 ... 어쩌면 메신저 무엇을보고 잘못된 멀게하는 것입니다 무엇을 볼 http://www.bandsintown.com/api/responses#events-json 을 나는 놓쳤다? 누군가가 저에게 올바른 방향으로 나를 가리킬 수 있다면 고맙겠습니다. 내가 함께 시도 : data.title data.artists.title 제목 artists.titel 등 아무것도하지만 내있는 tableview에서 보여 ..... 고맙습니다 // R this.responseText
의 값이 무엇
그게 뭐니 뭐니해도 틀린거야? 오류가 있습니까? 오류 메시지의 정확한 텍스트와 행은 무엇입니까? –
오류가 없거나 그런 것입니다. 나는 그저 아무것도 볼 수 없어요. 그것은 내 테이블에 아무것도 보여주지 않을거야. –