@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大小发生改变
网友评论