美文网首页
修改导航栏高度

修改导航栏高度

作者: 刘振杰 | 来源:发表于2016-08-18 11:14 被阅读169次

    - (void)viewDidAppear:(BOOL)animated

    {

    [superviewDidAppear:animated];

    NSLog(@"修改前");

    [self printViewHierarchy:self.navigationController.navigationBar];

    //修改NavigaionBar的高度

    self.navigationController.navigationBar.frame=CGRectMake(0, 20, 320, 100);

    NSLog(@"\n修改后");

    [selfprintViewHierarchy:self.navigationController.navigationBar];

    }

    - (void)printViewHierarchy:(UIView*)superView

    {

    staticuintlevel = 0;

    for(uinti = 0; i < level; i++){

    printf("\t");

    }

    constchar*className =NSStringFromClass([superViewclass]).UTF8String;

    constchar*frame =NSStringFromCGRect(superView.frame).UTF8String;

    printf("%s:%s\n", className, frame);

    ++level;

    for(UIView*viewinsuperView.subviews){

    [selfprintViewHierarchy:view];

    }

    --level;

    }

    相关文章

      网友评论

          本文标题:修改导航栏高度

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