简体   繁体   English

点击活动 <ion-col> 不适用于IONIC 3应用程序的iOS

[英]Click Event of <ion-col> not working in iOS for IONIC 3 Application

I am working with ionic 3 application. 我正在使用离子3应用程序。 My homepage contains a grid of icons and I created a click event for <ion-col> that contain icons. 我的主页包含一个图标网格,我为<ion-col>创建了一个包含图标的点击事件。

HTML HTML

<ion-col col-4 text-wrap (click)="changeSubCategory(17)">
    <ion-icon ios="ios-boat" md="md-boat" class="iconstyle primary-font-color"></ion-icon>
    <br>
    <p class="pstyle">Travel</p>
</ion-col>

This event works very well on an Android device but somehow it's not working on iOS device. 此事件在Android设备上运行良好,但不知何故,它无法在iOS设备上运行。 I am also not getting any error in console. 我也没有在控制台中收到任何错误。

Just add the 'tappable' directive to your element. 只需将'tappable'指令添加到元素中即可。 Like: 喜欢:

 <ion-col text-center tappable (click)="presentSortedFoodModal('sugar')">
....
</ion-col>

I solved this issue. 我解决了这个问题。 My ion-grid was inside ion-list . ion-gridion-list i remove ion-list and place ion-gird outside <ion-list> and click event start working on the iOS device too. 我删除了ion-list并将ion-gird放在<ion-list>click事件开始在iOS设备上工作。

I am not sure this is correct approach or not but it solved my problem. 我不确定这是否正确,但它解决了我的问题。

better answers still welcome. 更好的答案仍然欢迎。

thanks 谢谢

我确实面临同样的问题,删除ion-list解决了我的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM