Files
NativeScript/tests/app/ui/label/label-tests-native.ios.ts
Panayot Cankov 1236f66f44 Add npm script that generates ios .d.ts-es from the tests app
Less than 30 erros left, let's hope it still works

Added lib.*.d.ts from typescript, removed lib and dom stuff, added by hand XHR, alert etc. .d.ts-es for polyfills

Roll back some changes involved in separating UIEvent for dom and ios

Test combined dts-es will now use lib, while internally we will not to avoid UIEvent conflict with dom stuff
2016-08-29 09:58:17 +03:00

27 lines
914 B
TypeScript

import labelModule = require("ui/label");
import enums = require("ui/enums");
import colorModule = require("color");
import utilsModule = require("utils/utils");
export function getNativeTextAlignment(label: labelModule.Label): string {
switch (label.ios.textAlignment) {
case NSTextAlignment.Left:
return enums.TextAlignment.left;
case NSTextAlignment.Center:
return enums.TextAlignment.center;
case NSTextAlignment.Right:
return enums.TextAlignment.right;
default:
return "unexpected value";
}
}
export function getNativeBackgroundColor(label: labelModule.Label): colorModule.Color {
var layer = (<UILabel>label.ios).layer;
if (!layer || !layer.backgroundColor) {
return undefined;
}
var uiColor = UIColor.colorWithCGColor(layer.backgroundColor);
return utilsModule.ios.getColor(uiColor);
}