Reputation: 616
I'm having a lot of trouble centering a ion-searchbar in my navigation bar. I've tried text-align and ion-grids, but nothing seems to work. I has to be the component.
index.html
<ion-header>
<ion-navbar>
<ion-toolbar>
<button class="home-menu" ion-button menuToggle>
<ion-icon name="menu"></ion-icon>
</button>
</ion-toolbar>
<ion-title>
<h1>Title Here</h1>
</ion-title>
<ion-searchbar class="search" [showCancelButton]="shouldShowCancel" (ionCancel)="onCancel($event)">
</ion-searchbar>
</ion-navbar>
index.scss
page-index {
ion-searchbar {
width: 60 % ;
text-align: center !important;
}
}
Upvotes: 1
Views: 2662
Reputation: 2373
Try this
page-index {
ion-searchbar {
width: 60%;
margin: 0 auto;
}
}
Upvotes: 1