Q:

How to also animate subview in navigation bar?

I have a subview in my navigation bar. I try to add it by this way:
  UIView *customView =
  [[UIView alloc] initWithFrame:
                  CGRectMake(0, 0, image.size.width + label.frame.size.width, 44)];
  UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
  [customView addSubview:imageView];
  [customView addSubview:label];
  [self.navigationController.navigationBar addSubview:customView];

However, when I try to push the navigation bar, the customView stays in the place, not animating following the sliding navigation bar. How can I achieve the animated subview? Is it even possible? Thanks!

A:

you should not add subview in that way
you have tospecify your view location in the left , right or title view 

self.navigationItem.titleView = YOURVIEW;  

or choose another location left or right  items in this way the the title view will added to the current view if you want to remove it just set it to nil in the place you want and reload it subviews again,

self.navigationItem.titleView = nil;

