cancel
Showing results for 
Search instead for 
Did you mean: 

SAP UI5 - SAP.M Lib - Pinch to Zoom in Win 8 Tablet

Former Member
0 Kudos

Hi Experts,

I was exploring the sap.m library of SAP UI5. I built a sample application using the Fiori style (followed the docs on SDN). I have deployed this app on the HANA cloud web server. I am accessing this application on a windows 8 tablet. Everything works good, except that I cannot pinch to zoom. However, if I access other sites like say google.com, the tablet allows it. Why a different behavior for UI5 apps? To confirm there is nothing wrong in my app, I accessed demo UI5 apps on the SAP portal. Same behavior. Cannot pinch to zoom!

I tried accessing the same app on a android phone and surprisingly I am able to use 'pinch to zoom'.

Any comments on why this is happening on windows 8 tablets?

Thx.

Accepted Solutions (0)

Answers (2)

Answers (2)

AndreasKunz
Advisor
Advisor
0 Kudos

Hi Kevin,

if you look at native apps (except for those displaying maps or images), you'll notice that most do not allow pinch-to-zoom either. I would even feel strange to the user if the iOS settings or the gmail list of e-mails would zoom, no? So this is why in UI5 apps - which are typically rather apps than web pages pinch-to-zoom is also disabled.

For your own app, however, you could modify this behavior by calling jQuery.sap.initMobile({viewport: false}) which disables any settings for the viewport:

https://sapui5.hana.ondemand.com/sdk/docs/api/symbols/jQuery.sap.html#.initMobile

You have to do any viewport settings for yourself then, google will help you find information.

See this live example:

http://jsbin.com/openui5-no-viewport/1/edit?html,output

Regards

Andreas

Former Member
0 Kudos

Hi Andreas,

Thanks for your response. I did implement the code as you mentioned. However, the behavior is still the same. Additionally, I installed the chrome browser on my tablet, and guess what,  pinch to zoom works absolutely fine (without - jQuery.sap.initMobile({viewport: false}) piece of code). However, on the default IE on the tablet, the zoom fails.

Regards,

Kevin

Former Member
0 Kudos

Any responses? I also tried manually setting the following in my Component.JS file:

sap.ui.Device.system.tablet = true;
sap.ui.Device.system.desktop = false;

But its still the same behavior. Any suggestions?