功能知道是平板电脑,iPad,智能手机?

Jua*_*eda 1 android appcelerator ios

有没有办法知道应用程序是否正在运行:Android 平板电脑、iPad 或智能手机(手持设备)?

我正在使用 Titanium Appcelerator SDK 5.3.0GA 的经典开发。

谢谢

小智 5

您可以区分平板电脑和掌上电脑

在控制器中:

Alloy.isTablet or Alloy.isHandheld.
Run Code Online (Sandbox Code Playgroud)

TSS:

"Label[platform=ios formFactor=handheld]": {
    backgroundColor: "#f00",
    text: 'iPhone'
},
Run Code Online (Sandbox Code Playgroud)

功能知道是平板电脑,iPad,智能手机?

http://docs.appcelerator.com/platform/latest/#!/guide/Alloy_Styles_and_Themes