I am having some problems with certaing subviews alpha animation of my navigation bar. Here is the initial state of the panel:

Here is how far I have already managed:

The fact is that I need to make all these "stars", "new" and other round buttons transparent when the search is active (I need to reduce their alpha to zero). I am trying to make them transparent in the following delegate methods:
- (void)searchBarCancelButtonClicked:(UISearchBar *)asearchBar - (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar - (void)searchBarTextDidEndEditing:(UISearchBar *)searchBar - (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar
In all of them I am doing exactly the same code:
//parent is just a pointer of a search delegate, which points to view controller for (UIView * someViewToFade in parent.navigationController.navigationBar.subviews) { if (someViewToFade.tag == 88 || someViewToFade.tag == 11) { NSLog("someViewToFade.alpha before changes = %f", someViewToFade.alpha); someViewToFade.alpha = 0.0; //or 1.0, depending on the method } }
However, I could not achieve the desired result this way, although I get the correct alpha values ββin this NSLog, the buttons do not disappear at all. Are there any suggestions on what I can do wrong?
EDIT 1:
I think I should add some description of the view hierarchy in my case. Well, I have a UISegmentedConrol that contains these round buttons, as well as two UIImageViews, a background for segmented control and a triangle pointer. All these views are added to the navigation bar when it is in view mode. There is also a rectangular view that contains the search bar, and is also added as a subzone to the navigation bar later, so this is a top view in the hierarchy. In addition, I animate my searchBar by simply animating the frame of my supervisor (expanding or reducing it when the events above occur in the delegate). I hope I have provided all the necessary information.
morgan1189
source share