1、在自定义titleview的.h文件 里重写 intrinsicContentSize 属性
@property(nonatomic, assign) CGSize intrinsicContentSize;
2、控制器中这样写
// 导航栏控件 NavTitleView *titleView = [[NavTitleView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 44)]; titleView.intrinsicContentSize = CGSizeMake(SCREEN_WIDTH, 44); titleView.backgroundColor = [UIColor clearColor]; self.navigationItem.titleView = titleView;