Skip to content

Instantly share code, notes, and snippets.

@hisamekms
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hisamekms/20a46165181496ae7fb6 to your computer and use it in GitHub Desktop.
Save hisamekms/20a46165181496ae7fb6 to your computer and use it in GitHub Desktop.
TitaniumでiPhone 6を判定する ref: http://qiita.com/hisamekms/items/41eb6689c7423dce9e01
var platformHeight = Ti.Platform.displayCaps.platformHeight;
Alloy.Globals.isIPhone6Plus = platformHeight === 736;
Alloy.Globals.isIPhone6 = platformHeight === 667;
Alloy.Globals.isIPhone5 = platformHeight <= 568;
var platformHeight = Ti.Platform.displayCaps.platformHeight
Alloy.Globals.isIPhone6Plus = platformHeight === 736
Alloy.Globals.isIPhone6 = platformHeight === 667
Alloy.Globals.isIPhone5 = platformHeight <= 568
"Label[if=Alloy.Globals.isIPhone6Plus]": {
text: "iPhone 6 Plus"
}
"Label[if=Alloy.Globals.isIPhone6]": {
text: "iPhone 6"
}
"Label[if=Alloy.Globals.isIPhone5]": {
text: "iPhone 5 or earlier"
}
"Label[if=Alloy.Globals.isIPhone6Plus]": {
text: "iPhone 6 Plus"
}
"Label[if=Alloy.Globals.isIPhone6]": {
text: "iPhone 6"
}
"Label[if=Alloy.Globals.isIPhone5]": {
text: "iPhone 5 or earlier"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment