开发者

iPhone UISearchBar animated to top

开发者 https://www.devze.com 2022-12-30 01:19 出处:网络
There are lots of apps where the searchbar moves upwards if active and moves down wh开发者_运维知识库en it is inactive. There is a sample code from apple available which works with IB, but how can I a

There are lots of apps where the searchbar moves upwards if active and moves down wh开发者_运维知识库en it is inactive. There is a sample code from apple available which works with IB, but how can I achieve this behavior programmatically? Mostly it is combined with a navigationbar which moves out of the screen in replace with the searchbar


Personally, I ended up using [self.navigationController setNavigationBarHidden:YES animated:YES]; when the search begins and then just do [self.navigationController setNavigationBarHidden:NO animated:YES]; once the search is done.


When the search bar becomes first responder it will animate itself. You can call [searchBar becomeFirstResponder]; or something like that, checkpoint the docs.

0

精彩评论

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