问题
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