Implemented LiveSync page reload.

Fixed iOS layout bug
This commit is contained in:
hshristov
2015-11-06 16:45:20 +02:00
parent f7efef40df
commit 35b8209ddb
3 changed files with 16 additions and 1 deletions

View File

@@ -156,6 +156,10 @@ app.init({
onCreate: function () {
exports.android.init(this);
},
onLiveSync: function () {
frame.reloadPage();
}
});

6
ui/frame/frame.d.ts vendored
View File

@@ -245,4 +245,8 @@ declare module "ui/frame" {
*/
navBarVisibility: string;
}
}
//@private
export function reloadPage(): void;
//@endprivate
}

View File

@@ -196,6 +196,10 @@ export class Frame extends frameCommon.Frame {
this._heightMeasureSpec = heightMeasureSpec;
let result = this.measurePage(this.currentPage);
if (this._navigateToEntry && this.currentPage) {
this.measurePage(this._navigateToEntry.resolvedPage);
}
let widthAndState = view.View.resolveSizeAndState(result.measuredWidth, width, widthMode, 0);
let heightAndState = view.View.resolveSizeAndState(result.measuredHeight, height, heightMode, 0);
@@ -220,6 +224,9 @@ export class Frame extends frameCommon.Frame {
this._layoutWidth = right - left;
this._layoutheight = bottom - top;
this.layoutPage(this.currentPage);
if (this._navigateToEntry && this.currentPage) {
this.layoutPage(this._navigateToEntry.resolvedPage);
}
}
public layoutPage(page: pages.Page): void {