ios - Logo in Nav Bar Obj-C -


i trying display logo in navigation bar can't fit different sizes of phones. can fit 1 , looks terrible on another. closest ive gotten looking @ all. see how make better?

uiimage *logo = [uiimage imagenamed:@"wtb_logo"]; uiview *headerview = [[uiview alloc] init]; headerview.frame = cgrectmake(0, 0, 225, 115);  uiimageview *imgview = [[uiimageview alloc] initwithimage:logo]; imgview.frame = cgrectmake(0, 0, 205, 115); imgview.contentmode = uiviewcontentmodescaleaspectfit;  [headerview addsubview:imgview];  self.navigationitem.titleview = headerview; 

if understood problem image not centred within headerview. if image want don't use header @ all, titleview centred automatically.

self.navigationitem.titleview = imgview; 

if have button push image view. here's how looks: enter image description here enter image description here

so have make image little smaller.


Comments