I am trying to add a custom view in the center of a navigation bar and I am using the following code to test it:
UIView * testView = [[UIView alloc] init]; [
This works. Give frame at the time of initialisation
UIView *iv = [[UIView alloc] initWithFrame:CGRectMake(0,0,32,32)]; [iv setBackgroundColor:[UIColor whiteColor]]; self.navigationItem.titleView = iv;