Last active
March 17, 2020 13:09
-
-
Save EddyVerbruggen/c63f5bdaa79eac0a884fbd43707362a7 to your computer and use it in GitHub Desktop.
Changing the caret (cursor) color in NativeScript iOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class MyComponent implements AfterViewInit { | |
// assuming your view has this: <TextField #myTextField text="I have a red caret"></TextField> | |
@ViewChild("myTextField") myTextField: ElementRef; | |
ngAfterViewInit(): void { | |
// note that if you don't have iOS typings you can change 'UITextField' to 'any' | |
let textField: UITextField = (<TextField>this.myTextField.nativeElement).ios; | |
textField.tintColor = new Color("red").ios; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(this.myTextField.nativeElement).ios is always undefined.