mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(ios): searcbar hint color before hint property (#6902)
This commit is contained in:
@@ -3,7 +3,12 @@ import { Color } from "tns-core-modules/color";
|
||||
import { getColor } from "../helper";
|
||||
|
||||
export function getNativeHintColor(searchBar: SearchBar): Color {
|
||||
return (<any>searchBar)._placeholderLabel ? getColor((<any>searchBar)._placeholderLabel.textColor) : undefined;
|
||||
if ((<any>searchBar)._textField) {
|
||||
const placeholder = (<any>searchBar)._textField.valueForKey("placeholderLabel");
|
||||
return getColor(placeholder.textColor);
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export function getNativeTextFieldBackgroundColor(searchBar: SearchBar): Color {
|
||||
|
||||
@@ -92,6 +92,9 @@ export var testSearchBarPropertiesWithCSS = function () {
|
||||
helper.buildUIAndRunTest(_createSearchBarFunc(), function (views: Array<viewModule.View>) {
|
||||
var searchBar = <searchBarModule.SearchBar>views[0];
|
||||
|
||||
searchBar.text = "";
|
||||
searchBar.hint = "hint css test";
|
||||
|
||||
const expectedHintColor = "#0000FF"; // blue
|
||||
const expectedTextFieldBackgroundColor = "#FF0000"; // red
|
||||
const expectedFontSize = 30;
|
||||
@@ -105,8 +108,6 @@ export var testSearchBarPropertiesWithCSS = function () {
|
||||
TKUnit.assertAreClose(expectedFontSize, fontSizeActualValue, 0.2, "Font Size - Actual: " + fontSizeActualValue + "; Expected: " + expectedFontSize);
|
||||
}, { pageCss: `
|
||||
SearchBar {
|
||||
text: test;
|
||||
hint: test;
|
||||
text-field-hint-color: blue;
|
||||
text-field-background-color: red;
|
||||
font-size: 30;
|
||||
|
||||
Reference in New Issue
Block a user