Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Getting Started with NativeScript

You're reading from   Getting Started with NativeScript Explore the possibility of building truly native, cross-platform mobile applications using your JavaScript skill—NativeScript!

Arrow left icon
Product type Paperback
Published in Jan 2016
Publisher
ISBN-13 9781785888656
Length 168 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Nathanael J. Anderson Nathanael J. Anderson
Author Profile Icon Nathanael J. Anderson
Nathanael J. Anderson
Arrow right icon
View More author details
Toc

Platform- and device-specific files


The last method to differentiate between platforms is through platform- and device-specific files. These qualifiers are applicable to JavaScript, CSS, and the Declarative UI XML files. You can prefix the extension of a file with .android or .ios, so the file is main-file.ios.js or main-file.android.xml. Then, only this version of the file will be loaded on that specific platform. Once the version is loaded it allows you to have a completely custom JavaScript, CSS, or Declarative UI for each platform.

In addition to the platform qualifiers, you can also use device qualifiers such as .land for landscape or .port for portrait. For screen sizes, the qualifiers minH, min, and minWH appended with a minimum number of pixels are used as qualifiers. So, the main-page.minH300.css would require the device to have at least 300 pixels height for this CSS file to load. The . minHW400 qualifier would require that both the width and height be greater or equal to 400 pixels...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime