#iOS笔记#Navigation的titleView
2020-03-23 本文已影响0人
MAXcrazs
@interface HomeTitleView : UIView
@end
@implementation HomeTitleView
- (CGSize)intrinsicContentSize
{
return CGSizeMake(WF_ScreenWidth - 8, defaultSearchHeight);
}
@end
HomeTitleView *titleView = [HomeTitleView new];
self.navigationItem.titleView = titleView;
intrinsicContentSize,返回他的内容尺寸大小,防止由于navigation的titleView宽度限制,导致它的subview大小发生改变