1

In the current Google Currents iOS App (March 30th, 2013) there is a search button in the upper right corner. If you tap it, the button moves to the left and a text field 'grows' out of the right side. The other buttons are moved out of the left side in the same animation.

My question is: how would you achieve a behaviour like this? Is it possible to achieve this with UINavigationController (and UISearchBar/UISearchDisplayController) and other default iOS controls or did google wrote their own navigation controller? I appreciate any hint.

4

1 回答 1

0

All you have to do is use a UIView animation and widen the frame of the search bar. You will have to reduce it also in the same fashion...

[UIView animateWithDuration:0.8 
                  delay:0.0
                options:UIViewAnimationOptionBeginFromCurrentState
             animations:^{
                 searchFrame.size.width += 300;
                 searchbar.frame = searchFrame;
             }
             completion:nil];
于 2013-03-30T22:58:02.407 回答