Tag: titleview

如何解决在过渡期间被导航栏遮罩的titleView?

在我的视图控制器中,我将titleView设置为包含UIImageView的UIView , UIImageView在其图层上使用setCornerRadius制作成圆形。 圆的上半部分位于导航栏上方,下半部分位于视图上,如下所示: 现在,当我推动这个视图控制器,当它animation时,圆的下半部分被切断,直到animation完成。 只显示导航栏中的部分,如下所示: 一旦推动animation结束,显示完整的圆圈。 有什么办法可以阻止导航栏在animation发生时屏蔽/切断titleView ,以便在animation期间显示整个圆圈?

你可以用UIAppearance来设置UINavigationItem的titleview吗?

我目前使用这个代码来设置我的导航项目的titleView: – (void)viewDidLoad { … UIImage *navbarTitle = [UIImage imageNamed:@"navbartitleview1"]; UIImageView *imageView = [[UIImageView alloc]initWithImage:navbarTitle]; self.navigationItem.titleView =imageView; } 有没有办法,我可以把这个代码使用UIAppearance? [UINavigationItem appearance] 无效。

带有副标题的UINavigationBar TitleView

我想在我的UINavigationBar中有一个titleView,它有两行文本,而不是只有一行 当我有一个“返回”button和一个“编辑”button,因为它看起来接近居中,我目前的实施工作得很好。 问题是当我只有一个button。 它看起来很奇怪和错误,因为视图集中在可用空间上。 带有左右button的UINavigationBar UINavigationBar只有一个button 这是我目前的实现: CGRect frame = self.navigationController.navigationBar.frame; UIView *twoLineTitleView = [[UIView alloc] initWithFrame:CGRectMake(CGRectGetWidth(frame), 0, CGRectGetWidth(frame), CGRectGetHeight(frame))]; UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 8, CGRectGetWidth(frame), 14)]; titleLabel.backgroundColor = [UIColor clearColor]; titleLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth; titleLabel.textAlignment = UITextAlignmentCenter; titleLabel.text = self.title; [twoLineTitleView addSubview:titleLabel]; UILabel *subTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 23, CGRectGetWidth(frame), 14)]; subTitleLabel.backgroundColor = […]

iOS 11导航TitleView错位

我有一个iOS应用程序,我在其中设置自定义导航标题视图。 它工作正常,直到iOS 10,但在iOS 11的导航标题视图是错位的。 这里是iOS 10的屏幕截图 – 这里是iOS 11的屏幕截图 – 正如你在屏幕截图中看到的那样,当我在iOS 10上运行代码时,标题视图看起来很好。 但是,iOS 11上的相同代码将标题视图向下移动了一些像素,并被剪切掉。 这就是我如何设置标题视图 – navigationItem.titleView = MY_CUSTOM_TITLE_VIEW 我尝试了很多东西,并寻找很多解决scheme,但没有任何工作。