[英]Ionic 3 Buttons are not clickable within ion-content
I've got buttons which are not clickable when within the ion-content. 我有一些在离子含量内无法点击的按钮。 When I bring them out, they work just fine.
当我把它们带出来时,它们工作得很好。 Here's my HTML and SCSS.
这是我的HTML和SCSS。 Very strange behavior, maybe I'm missing something?
非常奇怪的行为,也许我错过了什么?
<ion-content no-bounce>
<div class="content_cover_exit">
<button class="exit-button" (click)="logoutUser()">
<ion-icon name="ios-exit-outline" class="icon-exit-class"></ion-icon>
EXIT
</button>
</div>
</ion-content>
.content_cover_exit {
width: 100%;
text-align: center;
position: fixed;
bottom: 70px;
z-index: 9999;
margin-bottom: constant(safe-area-inset-bottom);
margin-bottom: env(safe-area-inset-bottom);
}
.exit-button {
height: 2.0em;
border-radius: 5px;
opacity: 100%;
background-color: white;
font-size: 0.8em;
font-weight: 400;
letter-spacing: 1.2px;
color: $dark-text;
z-index: 999999;
}
.exit-button.activated {
background-color: white;
}
.icon-exit-class {
color: $dark-text;
}
UPDATE: Further research showed that even *ngIf doesn't work! 更新:进一步的研究表明,即使* ngIf也不起作用! this is begging to look super strange!
乞求看起来超级奇怪!
just add ion-button directive to you button tag and it will work fine. 只需将ion-button指令添加到您的按钮标签,它将可以正常工作。
ionic adds some enhanced with an ion-button directive. 离子通过离子按钮指令增加了一些增强。
<ion-content no-bounce>
<div class="content_cover_exit">
<button ion-button class="exit-button" (click)="logoutUser()">
<ion-icon name="ios-exit-outline" class="icon-exit-class"></ion-icon>
EXIT
</button>
</div>
</ion-content>
try like this 这样尝试
<ion-content no-bounce>
<div class="content_cover_exit">
<button class="exit-button"(click)="exitApp()">
<ion-icon name="ios-exit-outline" class="icon-exit-class"></ion-icon>
EXIT
<button>
</div>
</ion-content>
and your 和你的
.ts
import {Platform} from 'ionic-angular';
export MyPage {
constructor(platform: Platform) {
this.platform = platform;
}
exitApp(){
this.platform.exitApp();
} } }}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.