是否可以更改导航栏中标题 View 的大小?我想使用的一些标题太长,无法以当前大小显示,所以我想水平扩展titleview。这是我迄今为止尝试过的:
UIView *testView = [[UIView alloc] initWithFrame:CGRectMake(0,0,500,32)];
[testView setBackgroundColor:[UIColor redColor]];
self.navigationItem.titleView = testView;
无论我将宽度设置得有多大,它都不会超出某个点。这是我看到的:
有没有办法解决这个问题?谢谢您的帮助
最佳答案
AFAIK 现在有一种简单的方法可以做到这一点。但是你可以使用 UINavigationController
的方法
- (instancetype)initWithNavigationBarClass:(Class)navigationBarClass toolbarClass:(Class)toolbarClass;
使用自定义 UINavigationBar 创建 UINavigationController。
关于ios - 更改导航栏中标题 View 的大小,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23527328/