If I do the following, the titleView will stretch:
UIImage * img =[UIImage imageNamed:@"isikota_small.png"]; UIImageView * uiImage= [[UIImageView alloc]initWithImage:img]; self.navigationItem.titleView = uiImage; PO(self.navigationItem.titleView);
If i do
UIImage * img =[UIImage imageNamed:@"isikota_small.png"]; UIImageView * uiImage= [[UIImageView alloc]initWithImage:img]; uiImage.frame = CGRectMake(0,0,66,33); uiImage.autoresizingMask = UIViewAutoresizingFlexibleHeight;
the title will also be stretched.
If I do this:
UIImage * img =[UIImage imageNamed:@"isikota_small.png"]; UIImageView * uiImage= [[UIImageView alloc]initWithImage:img]; uiImage.frame = CGRectMake(0,0,66,33); uiImage.autoresizingMask = UIViewAutoresizingFlexibleHeight;
Somehow, Apple is changing uiv.frame to CGRectMake(127, 6, 66, 33) .
There must be an elegant solution.
source share