带有提示的导航栏-替换为图像 [英] Navigation bar with prompt - replace with image

查看:56
本文介绍了带有提示的导航栏-替换为图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何用相同尺寸的图像替换带有提示的导航栏"? 我在其他应用程序中看到了这一点.我所能做的就是在没有任何提示的情况下单独替换导航栏.我想要带有提示的尺寸,以便可以放置一个高度较高的徽标.

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.

感谢任何资源.

推荐答案

我希望这对您有用.

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];

快乐编码:)

这篇关于带有提示的导航栏-替换为图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆