1
티타늄에 관해서는 작은 질문이 있습니다. 내가 뭘하려는 건 내 함수의 텍스트를 내보기의 레이블로 전달하는 것입니다. 누군가가 이것을 어떻게 성취 할 수 있는지 설명 할 수 있습니까? 이 함수는 다른 파일에 다음 레이블입니다.함수에서 티타늄으로보기 위해 텍스트를 보냅니다.
임이 일을하려고 : - 함수의 텍스트를 라벨에게>
를이 내 코드입니다 : 뷰의 코드 위의
//making the milking view
var milkingView = Ti.UI.createView({
backgroundColor: 'white'
});
var title = new Ti.UI.createLabel({
top: 20,
left: per25,
height: 30,
text: 'MilkingResults:',
color: 'black',
font: {fontSize: 18}
});
var text = new Ti.UI.createLabel({
top: 20,
left: per25,
height: 30,
text: 'here i want the text from the function',
color: 'black',
font: {fontSize: 18}
});
되고, 아래로 아래의 코드입니다 사전 기능은
function http_get(subpage) {
var url = "url" + subpage;
var http_client = Ti.Network.createHTTPClient({
// function called when the response data is available
onload : function(e) {
Ti.API.info("Received text: " + this.responseText);
alert('success');
},
// function called when an error occurs, including a timeout
onerror : function(e) {
Ti.API.debug(e.error);
alert('error');
},
timeout : 5000 // in milliseconds
});
// Prepare the connection.
http_client.open("GET", url);
// Send the request.
http_client.send();
};
감사
도움을 주셔서 감사합니다. 미안하지만, 나는 너무 늦게 awnser로 표시했습니다. –