当用户触摸网格布局时如何获得点击声音?
<GridLayout row="3" colSpan="2" columns="15*,75*,10*" height="12%" rows="*,*" class="card-large box" (tap)="onTap()">
<Label text="" 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="" 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)
但我想知道为什么点击 android 布局不会触发音效,..