美文网首页
修改导航栏titleView的尺寸

修改导航栏titleView的尺寸

作者: 赤焰军少帅林殊 | 来源:发表于2018-03-10 16:50 被阅读139次
    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

相关文章

网友评论

      本文标题:修改导航栏titleView的尺寸

      本文链接:https://www.haomeiwen.com/subject/zplbfftx.html