UINavigationController

 

1、不自定义UINavigation更换背景色,可以直接设置naviagationBar的背景色,通过barTintColor 属性设置。

2、UINavigationController作为容器时,会导致子controller被遮挡,可以设置子Controller的 edgesForExtendedLayout 和 automaticallyAdjustScrollViewInsets(自视图是UIScrollView时)解决:

-(instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // 解决被UINavigationController遮挡
        if([[[UIDevice currentDevice]systemVersion]floatValue]>=7.0)
        {
            self.edgesForExtendedLayout = UIRectEdgeNone;
            self.automaticallyAdjustsScrollViewInsets = NO;
        }
    }
    return self;
}

 

posted @ 2014-12-16 10:31  1oo1  阅读(218)  评论(0编辑  收藏  举报