Files
NativeScript/tests/app/ui/search-bar/search-bar-tests-native.ios.ts
2019-06-26 15:13:48 +03:00

22 lines
785 B
TypeScript

import { SearchBar } from "tns-core-modules/ui/search-bar";
import { Color } from "tns-core-modules/color";
import { getColor } from "../../ui-helper";
export function getNativeHintColor(searchBar: SearchBar): Color {
if ((<any>searchBar)._textField) {
const placeholder = (<any>searchBar)._textField.valueForKey("placeholderLabel");
return getColor(placeholder.textColor);
}
return undefined;
}
export function getNativeTextFieldBackgroundColor(searchBar: SearchBar): Color {
return (<any>searchBar)._textField ? getColor((<any>searchBar)._textField.backgroundColor) : undefined;
}
export function getNativeFontSize(searchBar: SearchBar): number {
return (<any>searchBar)._textField ? (<any>searchBar)._textField.font.pointSize : undefined;
}