Nativescript 当用户触摸gridlayout时,如何获得点击声音?

Nativescript 当用户触摸gridlayout时,如何获得点击声音?,nativescript,nativescript-angular,Nativescript,Nativescript Angular,当用户触摸gridlayout时,如何获得点击声音 <GridLayout row="3" colSpan="2" columns="15*,75*,10*" height="12%" rows="*,*" class="card-large box" (tap)="onTap()"> <Label text="&#xf17b;" class="fa centered icon-category" col="0" rowspan="2"></Labe

当用户触摸gridlayout时,如何获得点击声音

<GridLayout row="3" colSpan="2" columns="15*,75*,10*" height="12%" rows="*,*" class="card-large box" (tap)="onTap()">
    <Label text="&#xf17b;" class="fa centered icon-category" col="0" rowspan="2"></Label>
    <Label text="MyText" class="category-name" verticalAlignment="bottom" col="1" row="0"></Label>
    <Label text="numbers" verticalAlignment="top" col="1" row="1"></Label>
    <Label text="&#xf054;" class="fa centered icon-arrow" col="2" rowspan="2"></Label>
</GridLayout>

更新:我可以通过android原生api获得声音,代码如下:

让decorView:any=app.android.startActivity.getWindow().getDecorView() decorView.playSoundEffect(android.view.SoundEffectConstants.CLICK)


但是我想知道为什么点击安卓布局不会触发音效,…

上述代码应该可以正常工作。这里是当用户点击布局时触发声音效果的地方(魔术发生的地方)