mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
search-bar color not applied correctly
This commit is contained in:
@@ -106,7 +106,7 @@ class UISearchBarDelegateImpl extends NSObject implements UISearchBarDelegate {
|
|||||||
export class SearchBar extends common.SearchBar {
|
export class SearchBar extends common.SearchBar {
|
||||||
private _ios: UISearchBar;
|
private _ios: UISearchBar;
|
||||||
private _delegate;
|
private _delegate;
|
||||||
public _textField: UITextField;
|
private __textField: UITextField;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
@@ -119,7 +119,6 @@ export class SearchBar extends common.SearchBar {
|
|||||||
public onLoaded() {
|
public onLoaded() {
|
||||||
super.onLoaded();
|
super.onLoaded();
|
||||||
this._ios.delegate = this._delegate;
|
this._ios.delegate = this._delegate;
|
||||||
this._textField = SearchBar.findTextField(this.ios);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public onUnloaded() {
|
public onUnloaded() {
|
||||||
@@ -135,16 +134,11 @@ export class SearchBar extends common.SearchBar {
|
|||||||
return this._ios;
|
return this._ios;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static findTextField(view: UIView) {
|
get _textField(): UITextField {
|
||||||
for (let i = 0, l = view.subviews.count; i < l; i++) {
|
if (!this.__textField) {
|
||||||
let v: UIView = view.subviews[i];
|
this.__textField = this.ios.valueForKey("searchField");
|
||||||
if (v instanceof UITextField) {
|
|
||||||
return v;
|
|
||||||
} else if (v.subviews.count > 0) {
|
|
||||||
return SearchBar.findTextField(v);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return undefined;
|
return this.__textField;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user