mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Implemented LiveSync page reload.
Fixed iOS layout bug
This commit is contained in:
@@ -156,6 +156,10 @@ app.init({
|
||||
|
||||
onCreate: function () {
|
||||
exports.android.init(this);
|
||||
},
|
||||
|
||||
onLiveSync: function () {
|
||||
frame.reloadPage();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
6
ui/frame/frame.d.ts
vendored
6
ui/frame/frame.d.ts
vendored
@@ -245,4 +245,8 @@ declare module "ui/frame" {
|
||||
*/
|
||||
navBarVisibility: string;
|
||||
}
|
||||
}
|
||||
|
||||
//@private
|
||||
export function reloadPage(): void;
|
||||
//@endprivate
|
||||
}
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user