[TIMOB-6560] Android: tableView - separators alternate different sizes when anyDensity false
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2011-12-11T09:25:41.000+0000 |
Affected Version/s | Release 1.7.5, Release 1.8.0.1 |
Fix Version/s | n/a |
Components | Android |
Labels | n/a |
Reporter | Jon Alter |
Assignee | Marshall Culpepper |
Created | 2011-12-10T15:53:00.000+0000 |
Updated | 2014-06-19T12:44:24.000+0000 |
Description
When anyDensity is false, the separators between the tableViewRows alternate between think and thin. This is not the case when anyDensity is true.
See attached screenshot.
Steps to reproduce
Step 1: add the anyDensity: false property to your tiapp.xml Step 2: run the code below Step 3: notice the size of the separators between the rows
var win = Ti.UI.createWindow({backgroundColor:'#fff'});
var data = [
{title:'Row'},
{title:'Row'},
{title:'Row'},
{title:'Row'},
{title:'Row'},
{title:'Row'},
{title:'Row'},
{title:'Row'},
{title:'Row'},
{title:'Row'},
]
var tv = Ti.UI.createTableView({
data: data
});
win.add(tv);
win.open();
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>
<supports-screens android:anyDensity="false"/>
</manifest>
</android>
Workaround
Add your own separator to the row
var win = Ti.UI.createWindow({backgroundColor:'#fff'});
function createRow(){
var row = Ti.UI.createTableViewRow();
var separator = Ti.UI.createView({top:49, backgroundColor:'#000', height:2});
var title = Ti.UI.createLabel({text:'Row', left:10});
row.add(separator);
row.add(title);
return row;
}
var data = [
createRow(),
createRow(),
createRow(),
createRow(),
createRow(),
createRow(),
];
var tv = Ti.UI.createTableView({
data: data
separatorColor: 'white',
});
win.add(tv);
win.open();
Attachments
File | Date | Size |
---|---|---|
tableView.jpg | 2011-12-10T15:54:46.000+0000 | 30032 |
anyDensity: false, means that the UI is scaled. That means lines will change size and possibly be missing since at the time its being scaled, it's already been drawn. This has been true for Android since 1.6 IIRC.