更新时间:2023-12-05 16:49:46
那时您开始搜索时,可以创建活动指标,并使用addSubView
方法将其添加为UISearchBar
的subview
. >
When you start searching at that time you can create an activity indicator and add it as the subview
of UISearchBar
using addSubView
method.
UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
//set your frame for activity indicator
[searchBar addSubview: spinner];
[spinner startAnimating];
完成搜索后,请使用removeFromSuperView
方法将其从搜索栏中删除.
When you finish the search remove it from the search bar using removeFromSuperView
method.