iOS title centering improvements wip

This commit is contained in:
Adam Bradley
2015-09-15 16:14:08 -05:00
parent 6bcf1e112d
commit fc89e86c83
3 changed files with 34 additions and 14 deletions

View File

@ -9,6 +9,18 @@
Menu
</ion-title>
<ion-nav-items secondary>
<button>
<icon football></icon>
</button>
</ion-nav-items>
<ion-nav-items primary>
<button>
<icon baseball></icon>
</button>
</ion-nav-items>
</ion-navbar>

View File

@ -6,7 +6,6 @@ $toolbar-order-ios: (
back-button: 10,
menu-toggle: 20,
primary: 30,
title: 40,
secondary: 50
);
@ -22,14 +21,23 @@ $toolbar-ios-title-font-size: 1.7rem !default;
min-height: $toolbar-ios-height;
.toolbar-title {
order: map-get($toolbar-order-ios, title);
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
padding: 0px 72px;
pointer-events: none;
}
.toolbar-primary-item {
flex: 1;
order: map-get($toolbar-order-ios, primary);
}
.toolbar-secondary-item {
flex: 1;
text-align: right;
order: map-get($toolbar-order-ios, secondary);
}
@ -42,7 +50,7 @@ $toolbar-ios-title-font-size: 1.7rem !default;
font-size: $toolbar-ios-title-font-size;
font-weight: 500;
text-align: center;
margin-top: -2px;
pointer-events: auto;
}
.back-button {

View File

@ -52,17 +52,17 @@ export class ToolbarBase extends Ion {
}
afterViewChecked() {
if (this._queueAlign) {
this._queueAlign = false;
this._alignTitle();
}
// if (this._queueAlign) {
// this._queueAlign = false;
// this._alignTitle();
// }
}
/**
* TODO
*/
alignTitle() {
this._queueAlign = (this.titleAlign === 'center');
//this._queueAlign = (this.titleAlign === 'center');
}
_alignTitle() {
@ -139,14 +139,14 @@ export class Toolbar extends ToolbarBase {
super.onInit();
// TODO: THIS IS HORRIBLE, FIX
setTimeout(() => {
this.alignTitle();
// setTimeout(() => {
// this.alignTitle();
setTimeout(() => {
this.alignTitle()
}, 64);
// setTimeout(() => {
// this.alignTitle()
// }, 64);
}, 32);
// }, 32);
}
}