Native Script中的iOS 3D Touch支持

时间:2017-05-06 18:59:15

标签: javascript nativescript angular2-nativescript

我想通过Native Script在iOS中使用3D触控支持。目前有一个Plugin用于快速操作,但我想听取iOS设备的<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" rel="stylesheet"/> <!-- main navigation --> <nav class="navbar navbar-toggleable-md navbar-light"> <div class=""> <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#mainNav" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <a class="navbar-brand" href=""> <img class="img-fluid" src="https://twocan.co/public/images/shared/logos/logo-header.png" alt="Learn English with twocan.com" /> </a> <div class="collapse navbar-collapse" id="mainNav"> <ul class="navbar-nav mr-auto"> <li class="nav-item"> <a class="nav-link" href=""> <i class="fa fa-home" aria-hidden="true"></i> Foo </a> </li> <li class="nav-item"> <a class="nav-link" href=""> <i class="fa fa-certificate"></i> Foo </a> </li> <li class="nav-item"> <a class="nav-link" href=""> <i class="fa fa-lightbulb-o"></i> Foo </a> </li> </ul> <ul class="navbar-nav ml-auto"> <li class="nav-item"> <a class="nav-link" href=""> <i class="fa fa-sign-in"></i> Foo </a> </li> <span class="navbar-text"> / </span> <li class="nav-item"> <a class="nav-link" href=""> Foo <i class="fa fa-check"></i> </a> </li> </ul> </div> </div> </nav> <!-- end main navigation -->操作。我想使用本机iOS API执行此操作,但我不知道如何开始。
同一作者还有另一个Cordova插件,其中有一个函数,我们可以听取下面的强制触摸:

ForceTouch

如何在NativeScript iOS中访问3D Touch API

1 个答案:

答案 0 :(得分:2)

由于力触摸在Android中没有类似的功能,因此没有NativeScript抽象。您必须自己使用iOS库。

How to use Native Libraries

iOS force Touch documentation