diff --git a/apps/app/ui-tests-app/text-view/hint-text-color.xml b/apps/app/ui-tests-app/text-view/hint-text-color.xml
index a86de2fe0..04473a6c5 100644
--- a/apps/app/ui-tests-app/text-view/hint-text-color.xml
+++ b/apps/app/ui-tests-app/text-view/hint-text-color.xml
@@ -6,14 +6,14 @@
-
-
+
+
-
-
+
+
diff --git a/tns-core-modules/ui/text-field/text-field.ios.ts b/tns-core-modules/ui/text-field/text-field.ios.ts
index eb7ada5fe..745d57d0c 100644
--- a/tns-core-modules/ui/text-field/text-field.ios.ts
+++ b/tns-core-modules/ui/text-field/text-field.ios.ts
@@ -1,4 +1,4 @@
-import {
+import {
TextFieldBase, secureProperty, textProperty, hintProperty, colorProperty, placeholderColorProperty,
Length, paddingTopProperty, paddingRightProperty, paddingBottomProperty, paddingLeftProperty, _updateCharactersInRangeReplacementString, Color, layout
} from "./text-field-common";
@@ -48,7 +48,7 @@ class UITextFieldDelegateImpl extends NSObject implements UITextFieldDelegate {
this.firstEdit = false;
const owner = this._owner.get();
if (owner) {
- textProperty.nativeValueChange(owner, '');
+ textProperty.nativeValueChange(owner, '');
}
return true;
@@ -82,7 +82,7 @@ class UITextFieldDelegateImpl extends NSObject implements UITextFieldDelegate {
else {
if (range.location <= textField.text.length) {
const newText = NSString.stringWithString(textField.text).stringByReplacingCharactersInRangeWithString(range, replacementString);
- textProperty.nativeValueChange(owner, newText);
+ textProperty.nativeValueChange(owner, newText);
}
}
}
@@ -181,21 +181,23 @@ export class TextField extends TextFieldBase {
this.nativeView.secureTextEntry = value;
}
- [colorProperty.getDefault](): UIColor {
+ [colorProperty.getDefault](): { textColor: UIColor, tintColor: UIColor } {
// return this.nativeView.tintColor;
- return this.nativeView.textColor;
+ console.log("----> TextField: colorProperty.getDefault: " + this.nativeView.textColor)
+ return {
+ textColor: this.nativeView.textColor,
+ tintColor: this.nativeView.tintColor
+ };
}
- [colorProperty.setNative](value: UIColor | Color) {
- // NOTE: Do we need this code? We have placeholderColor.
- // let nativeValue = this.nativeView;
- // if (this.isShowingHint && value) {
- // nativeValue.textColor = value.colorWithAlphaComponent(0.22);
- // } else {
- // nativeValue.textColor = value;
- // nativeValue.tintColor = value;
- // }
- let color = value instanceof Color ? value.ios : value;
- this.nativeView.textColor = color;
+ [colorProperty.setNative](value: Color | { textColor: UIColor, tintColor: UIColor }) {
+ if (value instanceof Color) {
+ let color = value instanceof Color ? value.ios : value;
+ this.nativeView.textColor = color;
+ this.nativeView.tintColor = color;
+ } else {
+ this.nativeView.textColor = value.textColor;
+ this.nativeView.tintColor = value.tintColor;
+ }
}
[placeholderColorProperty.getDefault](): UIColor {
diff --git a/tns-core-modules/ui/text-view/text-view.ios.ts b/tns-core-modules/ui/text-view/text-view.ios.ts
index 625b9a378..d811556bd 100644
--- a/tns-core-modules/ui/text-view/text-view.ios.ts
+++ b/tns-core-modules/ui/text-view/text-view.ios.ts
@@ -135,7 +135,7 @@ export class TextView extends EditableTextBase implements TextViewDefinition {
if (placeholderColor) {
this.nativeView.textColor = placeholderColor.ios;
} else if (color) {
- // Use semi-transparent vesion of color for back-compatibility
+ // Use semi-transparent version of color for back-compatibility
this.nativeView.textColor = color.ios.colorWithAlphaComponent(0.22);
} else {
this.nativeView.textColor = UIColor.blackColor.colorWithAlphaComponent(0.22);
@@ -145,8 +145,10 @@ export class TextView extends EditableTextBase implements TextViewDefinition {
if (color) {
this.nativeView.textColor = color.ios;
+ this.nativeView.tintColor = color.ios;
} else {
- this.nativeView.textColor = UIColor.blackColor;
+ this.nativeView.textColor = null;
+ this.nativeView.tintColor = null;
}
}
}