Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6560] Android: tableView - separators alternate different sizes when anyDensity false

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2011-12-11T09:25:41.000+0000
Affected Version/sRelease 1.7.5, Release 1.8.0.1
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterJon Alter
AssigneeMarshall Culpepper
Created2011-12-10T15:53:00.000+0000
Updated2014-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

FileDateSize
tableView.jpg2011-12-10T15:54:46.000+000030032

Comments

  1. Don Thorp 2011-12-11

    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.

JSON Source