The setDensity function doesn't seem to be working as outlined in the documentation. I'm getting this error:
Uncaught TypeError: Object# <DisplayCaps> has no method 'setDensity'
for: if (Titanium.Platform.name == 'android') if (Titanium.Platform.displayCaps.getDensity() == "high") Titanium.Platform.displayCaps.setDensity("medium");
Everything in "Titanium.Platform.DisplayCaps" is read only. The setters that you see there auto generated and should be removed as they don't actually do anything.
Nope, you can't really do that. From what I see you have a few options:
- Use anyDensity = false, which will force the app to be laid out as if it where a 320x480 screen. What it really does it stretches things for you to fit in the screen.
- Do a layout that will support any density of screen that you may encounter, I would use percents to lay things out if you go this way
- Write a bit of code that will take the screen size and, you tell it what size you would like the screen to be, and then you can use it to scale your dimensions based on the ratio between those two sets of numbers, this is similar to using percentages, but will give you more control.
I am sure you have already seen this, but just in case you have not seen it (very helpful): https://wiki.appcelerator.org/display/guides/Using+density-specific+resources+on+Android
Can you explain what you mean by "the textfields are majorly offset from the other displays"? Some code and pictures would help?
Think you can help? Login to answer this question!