iOS的坐标真正从(0,0)开始

    if ([self respondsToSelector:@selector(setEdgesForExtendedLayout:)])
    {
        [self setEdgesForExtendedLayout:UIRectEdgeNone];
    }

在ViewDidLoad里面调用这句话。

另外如果想做导航栏穿透效果,最后是隐藏导航栏,然后自定义一个导航栏,如果在导航栏上增加遮罩的话会导致push操作卡顿现象,未解决该问题。


    [self.view addSubview:self.navView];
    [self.view bringSubviewToFront:self.navView];

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
    [self.navigationController setNavigationBarHidden:YES animated:animated];
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    [self.navigationController setNavigationBarHidden:NO animated:animated];
}


你可能感兴趣的:(iOS的坐标真正从(0,0)开始)