Adjust font size on mobile

Hi,

I am adapting an existing NG application to also run on mobile.

css positioning is great to put every element in the right place, but is it also possible to adjust the font size when running on mobile? Something like 16px or 20px is fine for a desktop but on mobile is invisible. I am rebuilding some forms and using fonts with 60px size in order to be visible on Safari under iphone.

Is there something like the css positioning to also adjust or change the font size?

Thanks and Happy Holidays to all!!!

On launch of the solution you can check the browseragent.
When you detect a mobile device execute these lines:

plugins.ngclientutils.setViewportMetaDefaultForMobileAwareSites();
	plugins.ngclientutils.setViewportMetaForMobileAwareSites(plugins.ngclientutils.VIEWPORT_MOBILE_DENY_ZOOM);

Hope that helps.

Great! Thank you Mark

Using the first line works great

Thanks Marc, I am also a user of your tip :-)

I noticed when using this code:

		if (scopes.svySystem.isIOSPlatform()) {
			plugins.ngclientutils.setViewportMetaDefaultForMobileAwareSites();
			plugins.ngclientutils.setViewportMetaForMobileAwareSites(plugins.ngclientutils.VIEWPORT_MOBILE_DENY_ZOOM);
		}

and connect an iPad to the Servoy Developer (application server), scopes.svySystem.isIOSPlatform() returns false. I was expecting it to return true. I did not yet try with a Tomcat server.

Am I missing something?

Best regards,

Hi Robert,

Since a couple of years Safari on iPad does not return ‘iOS’ in the userAgent info by default, forcing it to show the desktop version of websites.
It is still possible to switch to the iOS version by clicking the ‘aA’ symbol in the address bar and choose ‘request mobile website’.

Apart from missing the above info, you’re not missing something in Servoy ;-) and this is expected behaviour.

Hope this helps

Hi Marc

Thanks for the info and hint at the aA menu to request the Mobile Website. If I understand it correctly, any code in a selection like the code snippet above is useless, as the if condition is never true.

Best regards and I wish you a Happy New Year!
Robert