mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 21:01:34 +08:00
default value fixed
This commit is contained in:

committed by
hshristov

parent
7516ac6ab3
commit
805722a5b7
@ -6,6 +6,7 @@ import proxy = require("ui/core/proxy");
|
|||||||
|
|
||||||
// on Android we explicitly set propertySettings to None because android will invalidate its layout (so we skip unnecessary native call).
|
// on Android we explicitly set propertySettings to None because android will invalidate its layout (so we skip unnecessary native call).
|
||||||
var AffectsLayout = global.android ? dependencyObservable.PropertyMetadataSettings.None : dependencyObservable.PropertyMetadataSettings.AffectsLayout;
|
var AffectsLayout = global.android ? dependencyObservable.PropertyMetadataSettings.None : dependencyObservable.PropertyMetadataSettings.AffectsLayout;
|
||||||
|
var defailtItemWidthHeight = global.android ? 0 : Number.NaN;
|
||||||
|
|
||||||
function isWidthHeightValid(value: any): boolean {
|
function isWidthHeightValid(value: any): boolean {
|
||||||
return (value >= 0.0 && value !== Number.POSITIVE_INFINITY);
|
return (value >= 0.0 && value !== Number.POSITIVE_INFINITY);
|
||||||
@ -21,10 +22,10 @@ export class WrapLayout extends layouts.LayoutBase implements definition.WrapLay
|
|||||||
new proxy.PropertyMetadata(enums.Orientation.horizontal, AffectsLayout, undefined, isValidOrientation));
|
new proxy.PropertyMetadata(enums.Orientation.horizontal, AffectsLayout, undefined, isValidOrientation));
|
||||||
|
|
||||||
public static itemWidthProperty = new dependencyObservable.Property("itemWidth", "WrapLayout",
|
public static itemWidthProperty = new dependencyObservable.Property("itemWidth", "WrapLayout",
|
||||||
new proxy.PropertyMetadata(0, AffectsLayout, undefined, isWidthHeightValid));
|
new proxy.PropertyMetadata(defailtItemWidthHeight, AffectsLayout, undefined, isWidthHeightValid));
|
||||||
|
|
||||||
public static itemHeightProperty = new dependencyObservable.Property("itemHeight", "WrapLayout",
|
public static itemHeightProperty = new dependencyObservable.Property("itemHeight", "WrapLayout",
|
||||||
new proxy.PropertyMetadata(0, AffectsLayout, undefined, isWidthHeightValid));
|
new proxy.PropertyMetadata(defailtItemWidthHeight, AffectsLayout, undefined, isWidthHeightValid));
|
||||||
|
|
||||||
get orientation(): string {
|
get orientation(): string {
|
||||||
return this._getValue(WrapLayout.orientationProperty);
|
return this._getValue(WrapLayout.orientationProperty);
|
||||||
|
Reference in New Issue
Block a user