mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
Extracted view-related utility methods from "utils/utils" to "ui/utils" so that the "utils/utils" module does not depend on the view module.
This commit is contained in:
@ -816,6 +816,10 @@
|
|||||||
</TypeScriptCompile>
|
</TypeScriptCompile>
|
||||||
<TypeScriptCompile Include="ui\text-view\text-view.d.ts" />
|
<TypeScriptCompile Include="ui\text-view\text-view.d.ts" />
|
||||||
<TypeScriptCompile Include="ui\ui.ts" />
|
<TypeScriptCompile Include="ui\ui.ts" />
|
||||||
|
<TypeScriptCompile Include="ui\utils\utils.d.ts" />
|
||||||
|
<TypeScriptCompile Include="ui\utils\utils.ios.ts">
|
||||||
|
<DependentUpon>utils.d.ts</DependentUpon>
|
||||||
|
</TypeScriptCompile>
|
||||||
<TypeScriptCompile Include="utils\module-merge.ts" />
|
<TypeScriptCompile Include="utils\module-merge.ts" />
|
||||||
<TypeScriptCompile Include="utils\utils.android.ts">
|
<TypeScriptCompile Include="utils\utils.android.ts">
|
||||||
<DependentUpon>utils.d.ts</DependentUpon>
|
<DependentUpon>utils.d.ts</DependentUpon>
|
||||||
@ -1971,7 +1975,7 @@
|
|||||||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
||||||
</WebProjectProperties>
|
</WebProjectProperties>
|
||||||
</FlavorProperties>
|
</FlavorProperties>
|
||||||
<UserProperties ui_2scroll-view_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2editable-text-demo_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2absolute-layout-demo_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2gallery-app_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2content-view_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2web-view_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2layouts_2absolute-layout_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2layouts_2dock-layout_2package_1json__JSONSchema="" ui_2layouts_2grid-layout_2package_1json__JSONSchema="" ui_2layouts_2wrap-layout_2package_1json__JSONSchema="http://json.schemastore.org/package" />
|
<UserProperties ui_2layouts_2wrap-layout_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2layouts_2grid-layout_2package_1json__JSONSchema="" ui_2layouts_2dock-layout_2package_1json__JSONSchema="" ui_2layouts_2absolute-layout_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2web-view_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2content-view_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2gallery-app_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2absolute-layout-demo_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2editable-text-demo_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2scroll-view_2package_1json__JSONSchema="http://json.schemastore.org/package" />
|
||||||
</VisualStudio>
|
</VisualStudio>
|
||||||
</ProjectExtensions>
|
</ProjectExtensions>
|
||||||
</Project>
|
</Project>
|
@ -1,10 +1,10 @@
|
|||||||
import appModule = require("application/application-common");
|
import appModule = require("application/application-common");
|
||||||
import frame = require("ui/frame");
|
import frame = require("ui/frame");
|
||||||
import utils = require("utils/utils");
|
|
||||||
import types = require("utils/types");
|
import types = require("utils/types");
|
||||||
import view = require("ui/core/view");
|
import view = require("ui/core/view");
|
||||||
import definition = require("application");
|
import definition = require("application");
|
||||||
import enums = require("ui/enums");
|
import enums = require("ui/enums");
|
||||||
|
import uiUtils = require("ui/utils");
|
||||||
|
|
||||||
global.moduleMerge(appModule, exports);
|
global.moduleMerge(appModule, exports);
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ class Window extends UIWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public layoutSubviews(): void {
|
public layoutSubviews(): void {
|
||||||
utils.ios._layoutRootView(this._content, UIScreen.mainScreen().bounds);
|
uiUtils.ios._layoutRootView(this._content, UIScreen.mainScreen().bounds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
import definition = require("ui/page");
|
import definition = require("ui/page");
|
||||||
import viewModule = require("ui/core/view");
|
import viewModule = require("ui/core/view");
|
||||||
import trace = require("trace");
|
import trace = require("trace");
|
||||||
import utils = require("utils/utils");
|
import uiUtils = require("ui/utils");
|
||||||
|
|
||||||
global.moduleMerge(pageCommon, exports);
|
global.moduleMerge(pageCommon, exports);
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ class UIViewControllerImpl extends UIViewController {
|
|||||||
trace.write(this._owner + " didRotateFromInterfaceOrientation(" + fromInterfaceOrientation + ")", trace.categories.ViewHierarchy);
|
trace.write(this._owner + " didRotateFromInterfaceOrientation(" + fromInterfaceOrientation + ")", trace.categories.ViewHierarchy);
|
||||||
if (this._owner._isModal) {
|
if (this._owner._isModal) {
|
||||||
var parentBounds = (<any>this._owner)._UIModalPresentationFormSheet ? (<UIView>this._owner._nativeView).superview.bounds : UIScreen.mainScreen().bounds;
|
var parentBounds = (<any>this._owner)._UIModalPresentationFormSheet ? (<UIView>this._owner._nativeView).superview.bounds : UIScreen.mainScreen().bounds;
|
||||||
utils.ios._layoutRootView(this._owner, parentBounds);
|
uiUtils.ios._layoutRootView(this._owner, parentBounds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ class UIViewControllerImpl extends UIViewController {
|
|||||||
trace.write(this._owner + " viewDidLayoutSubviews, isLoaded = " + this._owner.isLoaded, trace.categories.ViewHierarchy);
|
trace.write(this._owner + " viewDidLayoutSubviews, isLoaded = " + this._owner.isLoaded, trace.categories.ViewHierarchy);
|
||||||
if (this._owner._isModal) {
|
if (this._owner._isModal) {
|
||||||
var parentBounds = (<any>this._owner)._UIModalPresentationFormSheet ? this._owner._nativeView.superview.bounds : UIScreen.mainScreen().bounds;
|
var parentBounds = (<any>this._owner)._UIModalPresentationFormSheet ? this._owner._nativeView.superview.bounds : UIScreen.mainScreen().bounds;
|
||||||
utils.ios._layoutRootView(this._owner, parentBounds);
|
uiUtils.ios._layoutRootView(this._owner, parentBounds);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this._owner._updateLayout();
|
this._owner._updateLayout();
|
||||||
@ -137,7 +137,7 @@ export class Page extends pageCommon.Page {
|
|||||||
|
|
||||||
if (fullscreen) {
|
if (fullscreen) {
|
||||||
this._ios.modalPresentationStyle = UIModalPresentationStyle.UIModalPresentationFullScreen;
|
this._ios.modalPresentationStyle = UIModalPresentationStyle.UIModalPresentationFullScreen;
|
||||||
utils.ios._layoutRootView(this, UIScreen.mainScreen().bounds);
|
uiUtils.ios._layoutRootView(this, UIScreen.mainScreen().bounds);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this._ios.modalPresentationStyle = UIModalPresentationStyle.UIModalPresentationFormSheet;
|
this._ios.modalPresentationStyle = UIModalPresentationStyle.UIModalPresentationFormSheet;
|
||||||
@ -148,7 +148,7 @@ export class Page extends pageCommon.Page {
|
|||||||
parent.ios.presentViewControllerAnimatedCompletion(this._ios, false, function completion() {
|
parent.ios.presentViewControllerAnimatedCompletion(this._ios, false, function completion() {
|
||||||
if (!fullscreen) {
|
if (!fullscreen) {
|
||||||
// We can measure and layout the modal page after we know its parent's dimensions.
|
// We can measure and layout the modal page after we know its parent's dimensions.
|
||||||
utils.ios._layoutRootView(that, that._nativeView.superview.bounds);
|
uiUtils.ios._layoutRootView(that, that._nativeView.superview.bounds);
|
||||||
}
|
}
|
||||||
|
|
||||||
that._raiseShownModallyEvent(parent, context, closeCallback);
|
that._raiseShownModallyEvent(parent, context, closeCallback);
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import common = require("ui/tab-view/tab-view-common");
|
import common = require("ui/tab-view/tab-view-common");
|
||||||
import definition = require("ui/tab-view");
|
import definition = require("ui/tab-view");
|
||||||
import dependencyObservable = require("ui/core/dependency-observable");
|
import dependencyObservable = require("ui/core/dependency-observable");
|
||||||
import utilsModule = require("utils/utils");
|
|
||||||
import trace = require("trace");
|
import trace = require("trace");
|
||||||
import utils = require("utils/utils");
|
import utils = require("utils/utils");
|
||||||
|
import uiUtils = require("ui/utils");
|
||||||
import view = require("ui/core/view");
|
import view = require("ui/core/view");
|
||||||
import imageSource = require("image-source");
|
import imageSource = require("image-source");
|
||||||
import types = require("utils/types");
|
import types = require("utils/types");
|
||||||
@ -244,8 +244,8 @@ export class TabView extends common.TabView {
|
|||||||
var height = utils.layout.getMeasureSpecSize(heightMeasureSpec);
|
var height = utils.layout.getMeasureSpecSize(heightMeasureSpec);
|
||||||
var heightMode = utils.layout.getMeasureSpecMode(heightMeasureSpec);
|
var heightMode = utils.layout.getMeasureSpecMode(heightMeasureSpec);
|
||||||
|
|
||||||
this._tabBarHeight = utilsModule.ios.getActualHeight(this._ios.tabBar);
|
this._tabBarHeight = uiUtils.ios.getActualHeight(this._ios.tabBar);
|
||||||
this._navBarHeight = utilsModule.ios.getActualHeight(this._ios.moreNavigationController.navigationBar);
|
this._navBarHeight = uiUtils.ios.getActualHeight(this._ios.moreNavigationController.navigationBar);
|
||||||
|
|
||||||
var density = utils.layout.getDisplayDensity();
|
var density = utils.layout.getDisplayDensity();
|
||||||
var measureWidth = 0;
|
var measureWidth = 0;
|
||||||
|
12
ui/utils/utils.d.ts
vendored
Normal file
12
ui/utils/utils.d.ts
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
declare module "ui/utils" {
|
||||||
|
import view = require("ui/core/view");
|
||||||
|
module ios {
|
||||||
|
/**
|
||||||
|
* Gets actual height of a [UIView](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIView_Class/) widget.
|
||||||
|
* @param uiView - An instance of UIView.
|
||||||
|
*/
|
||||||
|
export function getActualHeight(uiView: UIView): number;
|
||||||
|
|
||||||
|
export function _layoutRootView(rootView: view.View, parentBounds: CGRect): void;
|
||||||
|
}
|
||||||
|
}
|
78
ui/utils/utils.ios.ts
Normal file
78
ui/utils/utils.ios.ts
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
import view = require("ui/core/view");
|
||||||
|
import utils = require("utils/utils");
|
||||||
|
|
||||||
|
export module ios {
|
||||||
|
export function getActualHeight(uiView: UIView): number {
|
||||||
|
if (uiView.window && !uiView.hidden) {
|
||||||
|
return uiView.frame.size.height;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function _layoutRootView(rootView: view.View, parentBounds: CGRect) {
|
||||||
|
if (!rootView || !parentBounds) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var landscape = utils.ios.isLandscape();
|
||||||
|
var iOSMajorVersion = utils.ios.MajorVersion;
|
||||||
|
var size = parentBounds.size;
|
||||||
|
var width = size.width;
|
||||||
|
var height = size.height;
|
||||||
|
|
||||||
|
//trace.write("--------------------------------------------", "LayoutRootView.iOS");
|
||||||
|
//trace.write("| Layout Root View", "LayoutRootView.iOS");
|
||||||
|
//trace.write("| rootView: " + rootView, "LayoutRootView.iOS");
|
||||||
|
//trace.write("| parentBounds: " + NSStringFromCGRect(parentBounds), "LayoutRootView.iOS");
|
||||||
|
//trace.write("| UIScreen.mainScreen().bounds: " + NSStringFromCGRect(UIScreen.mainScreen().bounds), "LayoutRootView.iOS");
|
||||||
|
//trace.write("| _isModal: " + (<any>rootView)._isModal, "LayoutRootView.iOS");
|
||||||
|
//trace.write("| _UIModalPresentationFormSheet: " + (<any>rootView)._UIModalPresentationFormSheet, "LayoutRootView.iOS");
|
||||||
|
//trace.write("| landscape: " + landscape, "LayoutRootView.iOS");
|
||||||
|
//trace.write("| iOSMajorVersion: " + iOSMajorVersion, "LayoutRootView.iOS");
|
||||||
|
var superview = (<UIView>rootView._nativeView).superview;
|
||||||
|
//trace.write("| superview: " + superview, "LayoutRootView.iOS");
|
||||||
|
var superViewRotationRadians;
|
||||||
|
if (superview) {
|
||||||
|
superViewRotationRadians = atan2f(superview.transform.b, superview.transform.a);
|
||||||
|
//trace.write("| superViewRotationRadians: " + superViewRotationRadians + " rad.", "LayoutRootView.iOS");
|
||||||
|
//trace.write("| superview.bounds: " + NSStringFromCGRect(superview.bounds), "LayoutRootView.iOS");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (iOSMajorVersion < 8 && landscape && !superViewRotationRadians) {
|
||||||
|
// in iOS 7 when in landscape we switch width with height because on device they don't change even when rotated.
|
||||||
|
//trace.write("| >>> Detected iOS 7 device in landscape mode and superview is not rotated. Manually swapping width and height...", "LayoutRootView.iOS");
|
||||||
|
width = size.height;
|
||||||
|
height = size.width;
|
||||||
|
}
|
||||||
|
|
||||||
|
var statusBarHeight;
|
||||||
|
if (UIApplication.sharedApplication().statusBarHidden || ((<any>rootView)._UIModalPresentationFormSheet && !CGSizeEqualToSize(parentBounds.size, UIScreen.mainScreen().bounds.size))) {
|
||||||
|
statusBarHeight = 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Status bar section
|
||||||
|
var statusFrame = UIApplication.sharedApplication().statusBarFrame;
|
||||||
|
try {
|
||||||
|
statusBarHeight = Math.min(statusFrame.size.width, statusFrame.size.height);
|
||||||
|
} catch (ex) {
|
||||||
|
console.log("exception: " + ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//trace.write("| UIApplication.sharedApplication().statusBarHidden: " + UIApplication.sharedApplication().statusBarHidden, "LayoutRootView.iOS");
|
||||||
|
//trace.write("| statusBarHeight: " + statusBarHeight, "LayoutRootView.iOS");
|
||||||
|
|
||||||
|
var origin = parentBounds.origin;
|
||||||
|
var left = origin.x;
|
||||||
|
var top = origin.y + statusBarHeight;
|
||||||
|
|
||||||
|
var widthSpec = utils.layout.makeMeasureSpec(width, utils.layout.EXACTLY);
|
||||||
|
var heightSpec = utils.layout.makeMeasureSpec(height - statusBarHeight, utils.layout.EXACTLY);
|
||||||
|
|
||||||
|
//trace.write("| >>> Will measure and layout with {{" + left + ", " + top + "}{" + width + ", " + height + "}}", "LayoutRootView.iOS");
|
||||||
|
//trace.write("--------------------------------------------", "LayoutRootView.iOS");
|
||||||
|
|
||||||
|
rootView.measure(widthSpec, heightSpec);
|
||||||
|
rootView.layout(left, top, width, height);
|
||||||
|
}
|
||||||
|
}
|
8
utils/utils.d.ts
vendored
8
utils/utils.d.ts
vendored
@ -1,6 +1,5 @@
|
|||||||
declare module "utils/utils" {
|
declare module "utils/utils" {
|
||||||
import colorModule = require("color");
|
import colorModule = require("color");
|
||||||
import view = require("ui/core/view");
|
|
||||||
|
|
||||||
export var RESOURCE_PREFIX: string;
|
export var RESOURCE_PREFIX: string;
|
||||||
|
|
||||||
@ -129,11 +128,6 @@
|
|||||||
* @param uiColor - UIColor instance used to create a NativeScript color.
|
* @param uiColor - UIColor instance used to create a NativeScript color.
|
||||||
*/
|
*/
|
||||||
export function getColor(uiColor: UIColor): colorModule.Color;
|
export function getColor(uiColor: UIColor): colorModule.Color;
|
||||||
/**
|
|
||||||
* Gets actual height of a [UIView](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIView_Class/) widget.
|
|
||||||
* @param uiView - An instance of UIView.
|
|
||||||
*/
|
|
||||||
export function getActualHeight(uiView: UIView): number;
|
|
||||||
/**
|
/**
|
||||||
* Gets an information about if current mode is Landscape.
|
* Gets an information about if current mode is Landscape.
|
||||||
*/
|
*/
|
||||||
@ -142,8 +136,6 @@
|
|||||||
* Gets the iOS device major version (for 8.1 will return 8).
|
* Gets the iOS device major version (for 8.1 will return 8).
|
||||||
*/
|
*/
|
||||||
export var MajorVersion: number;
|
export var MajorVersion: number;
|
||||||
|
|
||||||
export function _layoutRootView(rootView: view.View, parentBounds: CGRect): void;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* An utility function that copies properties from source object to target object.
|
* An utility function that copies properties from source object to target object.
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import common = require("utils/utils-common");
|
import common = require("utils/utils-common");
|
||||||
import colorModule = require("color");
|
import colorModule = require("color");
|
||||||
import view = require("ui/core/view");
|
|
||||||
|
|
||||||
global.moduleMerge(common, exports);
|
global.moduleMerge(common, exports);
|
||||||
|
|
||||||
@ -60,14 +59,6 @@ export module ios {
|
|||||||
return new colorModule.Color(alpha, red, green, blue);
|
return new colorModule.Color(alpha, red, green, blue);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getActualHeight(uiView: UIView): number {
|
|
||||||
if (uiView.window && !uiView.hidden) {
|
|
||||||
return uiView.frame.size.height;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function isLandscape(): boolean {
|
export function isLandscape(): boolean {
|
||||||
var device = UIDevice.currentDevice();
|
var device = UIDevice.currentDevice();
|
||||||
var statusBarOrientation = UIApplication.sharedApplication().statusBarOrientation;
|
var statusBarOrientation = UIApplication.sharedApplication().statusBarOrientation;
|
||||||
@ -76,72 +67,6 @@ export module ios {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export var MajorVersion = NSString.stringWithString(UIDevice.currentDevice().systemVersion).intValue;
|
export var MajorVersion = NSString.stringWithString(UIDevice.currentDevice().systemVersion).intValue;
|
||||||
|
|
||||||
export function _layoutRootView(rootView: view.View, parentBounds: CGRect) {
|
|
||||||
if (!rootView || !parentBounds) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var landscape = isLandscape();
|
|
||||||
var iOSMajorVersion = MajorVersion;
|
|
||||||
var size = parentBounds.size;
|
|
||||||
var width = size.width;
|
|
||||||
var height = size.height;
|
|
||||||
|
|
||||||
//trace.write("--------------------------------------------", "LayoutRootView.iOS");
|
|
||||||
//trace.write("| Layout Root View", "LayoutRootView.iOS");
|
|
||||||
//trace.write("| rootView: " + rootView, "LayoutRootView.iOS");
|
|
||||||
//trace.write("| parentBounds: " + NSStringFromCGRect(parentBounds), "LayoutRootView.iOS");
|
|
||||||
//trace.write("| UIScreen.mainScreen().bounds: " + NSStringFromCGRect(UIScreen.mainScreen().bounds), "LayoutRootView.iOS");
|
|
||||||
//trace.write("| _isModal: " + (<any>rootView)._isModal, "LayoutRootView.iOS");
|
|
||||||
//trace.write("| _UIModalPresentationFormSheet: " + (<any>rootView)._UIModalPresentationFormSheet, "LayoutRootView.iOS");
|
|
||||||
//trace.write("| landscape: " + landscape, "LayoutRootView.iOS");
|
|
||||||
//trace.write("| iOSMajorVersion: " + iOSMajorVersion, "LayoutRootView.iOS");
|
|
||||||
var superview = (<UIView>rootView._nativeView).superview;
|
|
||||||
//trace.write("| superview: " + superview, "LayoutRootView.iOS");
|
|
||||||
var superViewRotationRadians;
|
|
||||||
if (superview) {
|
|
||||||
superViewRotationRadians = atan2f(superview.transform.b, superview.transform.a);
|
|
||||||
//trace.write("| superViewRotationRadians: " + superViewRotationRadians + " rad.", "LayoutRootView.iOS");
|
|
||||||
//trace.write("| superview.bounds: " + NSStringFromCGRect(superview.bounds), "LayoutRootView.iOS");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (iOSMajorVersion < 8 && landscape && !superViewRotationRadians) {
|
|
||||||
// in iOS 7 when in landscape we switch width with height because on device they don't change even when rotated.
|
|
||||||
//trace.write("| >>> Detected iOS 7 device in landscape mode and superview is not rotated. Manually swapping width and height...", "LayoutRootView.iOS");
|
|
||||||
width = size.height;
|
|
||||||
height = size.width;
|
|
||||||
}
|
|
||||||
|
|
||||||
var statusBarHeight;
|
|
||||||
if (UIApplication.sharedApplication().statusBarHidden || ((<any>rootView)._UIModalPresentationFormSheet && !CGSizeEqualToSize(parentBounds.size, UIScreen.mainScreen().bounds.size))) {
|
|
||||||
statusBarHeight = 0;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// Status bar section
|
|
||||||
var statusFrame = UIApplication.sharedApplication().statusBarFrame;
|
|
||||||
try {
|
|
||||||
statusBarHeight = Math.min(statusFrame.size.width, statusFrame.size.height);
|
|
||||||
} catch (ex) {
|
|
||||||
console.log("exception: " + ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//trace.write("| UIApplication.sharedApplication().statusBarHidden: " + UIApplication.sharedApplication().statusBarHidden, "LayoutRootView.iOS");
|
|
||||||
//trace.write("| statusBarHeight: " + statusBarHeight, "LayoutRootView.iOS");
|
|
||||||
|
|
||||||
var origin = parentBounds.origin;
|
|
||||||
var left = origin.x;
|
|
||||||
var top = origin.y + statusBarHeight;
|
|
||||||
|
|
||||||
var widthSpec = layout.makeMeasureSpec(width, common.layout.EXACTLY);
|
|
||||||
var heightSpec = layout.makeMeasureSpec(height - statusBarHeight, common.layout.EXACTLY);
|
|
||||||
|
|
||||||
//trace.write("| >>> Will measure and layout with {{" + left + ", " + top + "}{" + width + ", " + height + "}}", "LayoutRootView.iOS");
|
|
||||||
//trace.write("--------------------------------------------", "LayoutRootView.iOS");
|
|
||||||
|
|
||||||
rootView.measure(widthSpec, heightSpec);
|
|
||||||
rootView.layout(left, top, width, height);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function GC() {
|
export function GC() {
|
||||||
|
Reference in New Issue
Block a user