diff --git a/tns-core-modules/ui/button/button.ios.ts b/tns-core-modules/ui/button/button.ios.ts index bf5ffee97..9195d154c 100644 --- a/tns-core-modules/ui/button/button.ios.ts +++ b/tns-core-modules/ui/button/button.ios.ts @@ -21,6 +21,10 @@ export class Button extends ButtonBase { this.nativeView.addTargetActionForControlEvents(this._tapHandler, "tap", UIControlEvents.TouchUpInside); } + get ios() { + return this.nativeView; + } + public onUnloaded() { super.onUnloaded(); if (this._stateChangedHandler) { diff --git a/tns-core-modules/ui/text-base/text-base.ios.ts b/tns-core-modules/ui/text-base/text-base.ios.ts index 24c865955..fbba9e48a 100644 --- a/tns-core-modules/ui/text-base/text-base.ios.ts +++ b/tns-core-modules/ui/text-base/text-base.ios.ts @@ -3,8 +3,10 @@ textTransformProperty, letterSpacingProperty, colorProperty, fontInternalProperty, Font, Color, FormattedString, TextDecoration, TextAlignment, TextTransform } from "./text-base-common"; +import * as utils from "utils/utils"; export * from "./text-base-common"; + export class TextBase extends TextBaseCommon { public nativeView: UITextField | UITextView | UILabel | UIButton; @@ -56,20 +58,23 @@ export class TextBase extends TextBaseCommon { } //Color - get [colorProperty.native](): UIColor { + get [colorProperty.native](): Color { let nativeView = this.nativeView; if (nativeView instanceof UIButton) { - return nativeView.titleColorForState(UIControlState.Normal); + return utils.ios.getColor(nativeView.titleColorForState(UIControlState.Normal)); } else { - return nativeView.textColor; + return utils.ios.getColor(nativeView.textColor); } } - set [colorProperty.native](value: UIColor) { + set [colorProperty.native](value: Color) { + console.log("Setting native color: " + value); let nativeView = this.nativeView; if (nativeView instanceof UIButton) { - nativeView.setTitleColorForState(value, UIControlState.Normal); + if (value instanceof UIColor) { + nativeView.setTitleColorForState(value.ios, UIControlState.Normal); + } } else { - nativeView.textColor = value; + nativeView.textColor = value.ios; } }