QNimate

  • CoursesVideos
  • WP PremiumPlugins
  • DemosLab
  • Home
  • QIdea
  • QTrack
Home Carbon Ads Change Viewport Width using Intel XDK

Change Viewport Width using Intel XDK

This post is a part 13 of Intel XDK Complete Tutorial post series.

Suppose you have developed you app layout for 320 pixels width. If users are using your app on other small or large viewport then your app’s UI may break down. In this case you can actually virtualize the viewport width to 320px. For example: if width of device is 640px, you can make 2 viewport pixel equal to 1 viewport pixel and therefore prevent your app from breaking down.

We can do this with just one line of code.

//Parameters:
//1. Viewport virtual width in portrait orientation.
//2. Viewport virtual width in landscape orientation.
intel.xdk.display.useViewport(320,320);
Nov 7, 2014Narayan Prusty
Retrieve Viewport Height and Width In Intel XDKSigning Intel XDK Generated Android App

Leave a Reply Cancel reply

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax

Narayan Prusty

I am a software engineer specialising in Blockchain, DevOps and Go/JavaScript. This is my personal blog where I write about things that I learn and feel interesting to share.

7 years ago Cordova
Share this
0
GooglePlus
0
Facebook
0
Twitter
0
Linkedin
Related Articles
  • Launch Browser Inside Intel XDK App
  • Retrieve Viewport Height and Width In Intel XDK
  • Intel XDK Orientation Guide
  • Downloading Files and Showing Progress using Intel XDK
  • Accessing User Phone Contacts using Intel XDK
Our Sponsor
My Books

2014 - 2015 © QNimate
All tutorials MIT license