IOS Animation issue in UISearchBar

I am doing a lot of customization for a pair of search bars that are next to each other in the same view. Below is an animation block in which the search bar on the left is aligned to the width of the screen when selected. The end result is exactly what I want, but for some reason there is no animation when the UIView calls animateWithDuration.

- (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar {
UISearchBar *tempSearchBar = (UISearchBar *) searchBar;

if (tempSearchBar.tag == 1) {
    self.customSearchBar.frame = CGRectMake(0, 0, 185, 44);
    [UIView animateWithDuration:.3
                          delay:0
                        options:UIViewAnimationOptionCurveEaseInOut
                     animations:^{
                         self.customSearchBar.frame = CGRectMake(0, 0, 320, 44);
                         self.customLocationBar.frame = CGRectMake(320, 0, 0, 44);
                         self.customLocationBar.hidden = YES;
                     } completion:^(BOOL finished) {
                         self.customSearchBar.showsCancelButton = YES;
                     }];
    self.customSearchBar.autocorrectionType = UITextAutocorrectionTypeNo;
}
}

      

Any help would be greatly appreciated.

Thank!

+3
ios animation uisearchbar


source to share


No one has answered this question yet

Check out similar questions:

909
How do I change restrictions changes?
eleven
Animating the UISearchBar border width
6
UISearchBar animation hide button
3
The UISearchBar prompt does not animate when in the navigation bar.
2
UISearchBar with UISearchDisplayController animates external screen
1
Change structure of UISearchBar programmatically on orientation change
1
iOS8 UISearchBar in UIToolbar has no left padding
1
iOS - Move UISearchBar Programmatically
1
Two problems with UISearchBar when embedded in UINavigationBar
0
UISearchBar: strange expanding animation



All Articles
Loading...
X
Show
Funny
Dev
Pics