Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do automatically scaling font sizes work for android, using appcelerator?

Just trying to get clarification on this issue. Is the scaling of fonts working for android using this attribute? Its working for iOS, I know, but it doesn't seem to want to play nice for android.

I'm trying to make a label that has a string of varying size in it. Here is a sample of the code that I'm using:

var name = Titanium.UI.createLabel({ text:response.name, color:'#000', minimumFontSize:10, font:{fontSize:24,fontFamily:'Helvetica Neue'}, width:120, height:45, top:0, left:0, right:2, wordWrap:false, textAlign:'left' });
like image 664
stealthdyno Avatar asked Dec 16 '11 22:12

stealthdyno


People also ask

How do I stop system font size changing effects Android?

You cannot stop the user from changing the system font size; you'll just have to use dp and ignore the lint errors!

How do I change font size on android?

To make your font size smaller or larger: On your device, open the Settings app. Search and select Font size. To change your preferred font size, move the slider left or right.

What is default font size in mobile?

The ideal base font size for mobile screens is 16 pixels. Anything smaller and users will have to pinch and zoom to read.

What text size should I use?

16px is the minimum when it comes to desktop browsing, while for mobile browsing, the sizes around 16px will do. Use bigger sizes to increase readability and hierarchy, and make it easier for the reader so they don't get frustrated and leave your website.


1 Answers

Use 'sp' as measurement unit for font and 'dp' for sizes (example: fontSize: '24sp'). You can read more about density-specific resources on Android here.

like image 182
Paul Annekov Avatar answered Sep 20 '22 11:09

Paul Annekov