run script in webbrowser = result 1280 x 736 px var width = screen.width; var height = screen.height;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
1) I created a new application and in css set the page size of 1280 x 800 px.
2) I created and downloaded build
3) I uploaded the app to your tablet
4) Run app in tablet
My tablet has a resolution of 1280 x 800 px, application is longer by about 30% :-(
run script in app = result 962 x 553 px var width = screen.width; var height = screen.height;
Please someone help? Thank you very much..
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Make sure you are using the viewport meta tag.
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I attach PrintScreen...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes I have.. any other ideas? Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use
overflow: hidden;
in your CSS.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I spit on some css. I want to know why the body size does not fit on the screen !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The purpose of the viewport meta tag is to scale your app's content for different device sizes. When you use viewport the body content of the app assumes the size of the viewport and hence you should not use absolute px for the size. Whenever needed to specify size of elements you should use relative size (%) and not absolute px. To answer your question why body size does not fit the screen - notice that your device under test has viewport of 1080x1920 and the CSS pixel ratio is 2.5, that leaves CSS pixels to 432x768. Also, you have to consider the margin for the skin for the device, so the effective size will be slightly smaller.
Some tips on UI development for mobile : You can achieve scaling and responsiveness with CSS, but it is best to use mobile UI framework such as jQuery Mobile, App Framework, Framework 7 etc. to avoid discrepancies in UI on different platforms and screen sizes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That is the problem. Very much and thank you..
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page