TableViewRow borderBottom borderTop?
Hello, is it possible to assign different styles/colors to a TableViewRow bottom/top border? Or should I use a png as a backgroundImage?
4 Answers
-
Accepted Answer
Not possible. Need to use
backgroundImage
or add an overlapping child view. -
Here's an example of a TableViewRow with a top border, bottom border, and background gradient like this:
function createMyRow() { var result = Ti.UI.createTableViewRow({ className: 'myrow', height: 40, width: 'auto', backgroundGradient: { type: 'linear', colors: ['#f9f9f9','#d7d7d7'], startPoint: {x:0,y:0}, endPoint:{x:0,y:37}, backFillStart:false}, }); // top border result.add(Ti.UI.createView({ top: 0, height: 1, backgroundColor: '#ccc', })); // bottom border result.add(Ti.UI.createView({ bottom: 0, height: 1, backgroundColor: '#ccc', })); }
-
Add
separatorColor: '#ccc'
to your TableView. Titanium SDK 2.1.3.GA. Works for me on Android and should work for iPhone. -
Very useful tip Bryan Sloan, thanks!