0

I've looked through the official documentation on the Tabris site, but I've not yet found an answer. So, within a Tabris app, how does one determine the current OS its running within?

Specifically, I'd like to be able to detect Android or iOS.

Edit

I found this example on their site after @Holger posted the answer, I'm pasting here to help others:

var page = tabris.create("Page", {
  title: "Device Info",
  topLevel: true
});

["platform", "version", "model",  "language"].forEach(function(property) {
  tabris.create("TextView", {
    layoutData: {left: 10, right: 10, top: [page.children().last(), 10]},
    text: property + ": " + device[property]
  }).appendTo(page);
});

page.open();
4

1 回答 1

1

有一个名为“ClientDevice”的客户端服务。你可以从它那里得到平台、操作系统版本等。请参阅http://developer.eclipsesource.com/tabris/docs/1.4/working/client-services/client-device#the_clients_platform

于 2015-02-28T07:59:27.903 回答