Hi there I guess the title says it all. I use a UISearchBar for entering an address to establish a network connection. While the connection is made I want to show the activity indicator instead of the tiny BookmarkButton on the right side of the searchbar. As far as I can see there is no public declared property that would give me access to the correct subview of the searchbar. I have seen this been done, any thoughts?
The app "Wikipanion"(free) does it.
Monobono
2009-10-02 18:30:07
is this app native iphone app or a web app?
Rahul Vyas
2009-10-03 09:14:55
+1
A:
Just for the record:
for(UIView* view in self.subviews){
if([view isKindOfClass:[UITextField class]]){
searchField=view;
break;
}
}
if(searchField !=)) {
searchField.leftView = myCustomView;
}
You can subclass UISearchBar and call this code in the layoutSubview method. calling this code in layoutSubview makes sure that resize animations work properly.
Monobono
2010-04-26 19:24:13
Oh please use for-in loop `for(UIView* view in self.subviews){if([view isKindOfClass:[UITextField class]]){searchField=view;break;}}`.
KennyTM
2010-04-26 19:27:10