Nativescript: Device specific styles for ios iphone 6 .!!

Created on 22 Sep 2017  路  5Comments  路  Source: NativeScript/NativeScript

Hi all,

I would like to write separate styles for iphone 6 and higher. how can I do that in vanilla NS ???
I tried
page.ios.minW1080.css
but didn't work. any suggestion ??

question

Most helpful comment

Hi @NickIliev ,
Thanks for the response.
I have tried 'page.ios.minW326.css' and it worked for me.
I have taken the screen width as 326ppi, so it is working for higher versions also.for other ios devices I have created the 'page.ios.css' files.

All 5 comments

@sagar1911 does not support CSS qualifiers files. Instead, you can create different classes and load them in the respective XML files.
For iPhone 6 you do not need screen qualifier so page.ios.xml will do the job.
From this point, you can load your style for iOS (e.g. my-ios.style) in page.ios.xml and do the same for the Android styles.

Hi @NickIliev ,
Thanks for the response.
I have tried 'page.ios.minW326.css' and it worked for me.
I have taken the screen width as 326ppi, so it is working for higher versions also.for other ios devices I have created the 'page.ios.css' files.

Hi @NickIliev,

Can you share how that file may be added to the xml file? I know it is a really noob question.

Hi,

I think this doc gives that answer: https://docs.nativescript.org/ui/styling#applying-css-styles

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rLoka picture rLoka  路  3Comments

valentinstoychev picture valentinstoychev  路  3Comments

guillaume-roy picture guillaume-roy  路  3Comments

dhanalakshmitawwa picture dhanalakshmitawwa  路  3Comments

minjunlan picture minjunlan  路  3Comments