Can't scale down the viewport to fit the app to the screen

1,836 views
Skip to first unread message

Aeris Shimmer

unread,
Sep 28, 2013, 7:47:08 PM9/28/13
to phon...@googlegroups.com
Hey guys,

I am currently porting a LANDSCAPE html5 app that is designed for 1366x768 resolution using phone gap to android (HTC one device)

I am having a really hard time to make the page fit to screen. The content appears almost alway too large

I have tried below options discussed on the web:


1. Adding viewport meta tag, tried added below options

1)<meta name="viewport" content="width=1366" />

2)<meta name="viewport" content="width=device-width" />

3)<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width" /> 

4)<meta name="viewport" content="target-densitydpi=device-dpi, width=1366" /> 

5)<meta name="viewport" content="initial-scale=1.0" />



2. Adding css tranform to the html or body --> didn't work on any newly created fixed position element added to DOM through JScript

Can anyone tell me what is the right way to go?






Karsten Vestergaard

unread,
Nov 6, 2013, 6:19:54 PM11/6/13
to phon...@googlegroups.com
I have the exact same problem on both Galaxy S4 and Nexus 7. My App is landscape only. Maybe it is something about setting the width. If it thinks that the width is taken from a portrait position. I can't imagine that this is the problem, but is is quite consistent.

Anyone else has experienced this and found a solution
/ockley

Tue Topholm

unread,
Nov 9, 2013, 2:05:27 AM11/9/13
to phonegap
Play around with the initial-scale=1, maximum-scale=1


--

Med venlig hilsen / Kind regards

Tue Topholm
Sugee
Tlf: +45 32 13 32 32
W: http://www.sugee.dk


2013/11/7 Karsten Vestergaard <vestergaa...@gmail.com>

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
 
To compile in the cloud, check out build.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

dbeuning

unread,
Nov 13, 2013, 1:47:15 PM11/13/13
to phon...@googlegroups.com
I'm using

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

Reference this article: http://developer.android.com/guide/webapps/best-practices.html

Dale Beuning

On Saturday, September 28, 2013 4:47:08 PM UTC-7, Aeris Shimmer wrote:
Hey guys,

..

Gaz

unread,
Nov 14, 2013, 2:00:08 AM11/14/13
to phon...@googlegroups.com

Dale Beuning

unread,
Nov 14, 2013, 1:44:27 PM11/14/13
to phon...@googlegroups.com
Suggest you don't use target-densitydpi
  <meta name="viewport" content="width=640, target-densitydpi=device-dpi" />

Why?  Chrome is default webview as of KitKat 4.4, and Chrome doesn't support target-densitydpi.

According to this best practices article use width=device-width:
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">

I'm using:
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

Dale Beuning
Reply all
Reply to author
Forward
0 new messages