开发者

add searchbar in UItoolbar

i 开发者_Go百科want to know is this possible to add a searchbar in UItoolbar


I just had a quick look and while interface builder will let you do it, when you try to save a warning pops up a warning saying the following "UISearchBars are not supported in UIBarButtonItems in non-iPad documents". That being said, it might be possible to make your own view that looks and works like a UIToolbar that does allow a UISearchBar.


You can nest:

navItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithCustomView: m_searchBar] autorelease];


If you get an error stating:

 UISearchBars are not supported in UIBarButtonItems in non-iPad documents

adding a UISearchBar to a view within a UIBarButtonItem worked for me.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜