修改导航栏titleView的尺寸

原文链接:http://www.jianshu.com/p/9406822251ec
    TopView* topview=[[TopView alloc] initWithFrame:CGRectMake(-5,0, SCREEN_WIDTH, 44)];
    topview.backgroundColor=[UIColor greenColor];
    [self.view addSubview:topview];
//    [topview mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.equalTo(@0);
//        make.left.equalTo(@0);
//        make.right.equalTo(@-0);
//        make.bottom.equalTo(@-0);
//    }];
  
    self.navigationItem.titleView=topview;

#import "TopView.h"

@implementation TopView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
//        self.backgroundColor=[UIColor greenColor];
    }
    return self;
}



- (void)setFrame:(CGRect)frame {
    
    
    [super setFrame:CGRectMake(-8, 0, SCREEN_WIDTH, 44)];


}

@end
展开阅读全文

没有更多推荐了,返回首页