Reputation: 560
I have created a TableView and then e created in a for as many TableViewRow as I need. The TableViewRow is created as folow:
var row = Ti.UI.createTableViewRow({
selectBackgoundColor : 'transparent',
height : '35%'
});
When I run my code in IOS it works perfect but in Android I need do change "height : '35%'" to a value that is not in % like "height : 121".
Why does "height : '35%'" not work in Android?
Upvotes: 0
Views: 47
Reputation: 24815
Height 35%
doesn't work on Android, because Android doesn't know what to use for the 100%
. There are a couple of solutions you could use.
From the deviceHeight you can easily calculate 35%
var deviceHeight = Ti.Platform.displayCaps.platformHeight;
if (OS_ANDROID){
deviceHeight = Math.round(Ti.Platform.displayCaps.platformHeight/Ti.Platform.displayCaps.logicalDensityFactor);
}
var thirtyFive = deviceHeight * 0.35;
Upvotes: 4