mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
iOS title centering improvements wip
This commit is contained in:
@ -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>
|
||||
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user