Navigation bar with prompt - replace with image

烂漫一生 提交于 2019-12-25 04:06:25

问题


How can I make replace a "navigation bar with prompt" with a same size image? I have seen this in other apps. All I can do is replace the navigation bar alone with no prompt. I want the size with the prompt so that I can put a heighty logo.

Thanks for any resource.


回答1:


i hope this works for u.

self.navigationItem.prompt = @"";
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"YOUR IMAGE NAME"]];
imageView.frame = CGRectMake(self.view.frame.size.width/2, 0, 10, 10); //change height and width accordingly
[self.navigationController.navigationBar addSubview:imageView];

happy coding :)



来源:https://stackoverflow.com/questions/10479475/navigation-bar-with-prompt-replace-with-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!