Ionic 2 Navbar Left And Right Button Not Working
Because of the title issue in ionic 2 for android. i have set some css and make centre of title.and i have put the left and right button in the nav bar. but when i apply the onclic
Solution 1:
Here is the solution that works.
<ion-header><ion-navbar><ion-buttons *ngIf="user != null"left><buttonion-buttonmenuToggle><ion-iconname="menu"></ion-icon></button></ion-buttons><ion-buttons *ngIf="user == null"left><buttonion-button (click)="loginBtnClicked()"><ion-iconname="log-in"></ion-icon></button></ion-buttons><ion-title>Home</ion-title><ion-buttonsright><buttonion-button (click)="searchClicked()"><ion-iconname="search"></ion-icon></button></ion-buttons>
Solution 2:
I faced the same issue in ionic3.
Please use button
tag with ion-buttons
and this solution works for me.
<!-- begin snippet: js hide: false console: true babel: false --><!-- language: lang-html --><ion-header><!-- use ion-toolbar for a normal toolbar and ion-navbar for navigation --><ion-toolbar><buttonion-buttonsclass="loginnavbtn" (click)="goback()"left>
CANCEL
<!-- left aligned content here --></button><ion-title>
LOGIN
</ion-title><buttonion-buttonsclass="loginnavbtn" (click)="loginbtntap()"right>
SAVE
<!-- left aligned content here --></button></ion-toolbar></ion-header><ion-content></ion-content>
Solution 3:
Try to use ion-button
<buttonion-buttonclass="loginnavbtn" (click)="goback()"left>Name of button</button>
Post a Comment for "Ionic 2 Navbar Left And Right Button Not Working"