2011-05-10 3 views
2

TableView를 구현해야하는 응용 프로그램을 만들고 있습니다.tableview 티타늄의 배경 이미지

tableview에 배경 이미지를 적용하고 싶습니다.

누구든지이 문제를 해결할 수 있도록 도와 줄 수 있습니까? 나는 어떤 도움이 이해할 수있을 것이다

Titanium.UI.setBackgroundColor('#FFF'); 

var win = Titanium.UI.currentWindow; 


var data = [ 
{title:'Owner Description:'+' '+Titanium.App.Properties.getString("latitude"),hasChild:false,color:'blue', selectedColor:'#fff', setFont:10}, 
{title:'TerminalDescription:'+' '+Titanium.App.Properties.getString("TerminalDesc"),hasChild:false}, 
{title:'Address:'+' '+Titanium.App.Properties.getString("address"),hasChild:false}, 
{title:'City:'+' '+Titanium.App.Properties.getString("city"),hasChild:false}, 
{title:'State:'+' '+Titanium.App.Properties.getString("state"),hasChild:false}, 
{title:'Zip:'+' '+Titanium.App.Properties.getString("Zip"),hasChild:false}, 
{title:'Surcharge Amount:'+' '+Titanium.App.Properties.getString("Charge"),hasChild:false}, 
]; 


var tableview = Titanium.UI.createTableView({ 
    data:data, 
    opacity:'.4', 
    maxRowHeight:'20', 
    //Set BG transparent 
    backgroundColor:'transparent', 
    backgroundImage:'Default.png', 
    //Set row color - white 
    rowBackgroundColor:'white' 

}); 


win.add(tableview); 

테이블보기를 생성하는 코드 아래 사용하고 있습니다.

+0

당신이 테이블보기에서 하나의 배경을 원하십니까, 또는이 배경 테이블 뷰의 각 행에 표시 할? –

답변

6

단일 이미지를 전체 TableView의 배경으로 사용하려는 경우. 부모보기로 backgroundImage을 설정하고 TableViewbackgroundColortransparent으로 설정하십시오. 코드는 동일한에 대한 수정 태그 :

var win = Titanium.UI.currentWindow; 
setBackgroundImage('Default.png'); 

var data = [ ... ]; 

var tableview = Titanium.UI.createTableView({ 
    data:data, 
    maxRowHeight:'20', 
    backgroundColor:'transparent', //Set BG transparent 
    rowBackgroundColor:'white' 
}); 

win.add(tableview); 

Reference